Change sale header oddity

Hello fellow Trytonies,

just faced a strange problem:
When trying to alter a party in a sale with the “modify header” wizard, I got the message "A value is required for field “Unit price” in "[first-product-in-list] of “Sale Line”.
But there is a Unit value, I can e.g. create a quotation with that sale - but not change the header.

Tryton 7.0, setup updated just now.
What could be wrong?

Thanks a lot in advance, Wolf

I suspect that the prices are being recalculated when you change the price list, and since some time if it is not defined in the pricelist, then it will return no price. Before it returned the list_price.

Are you using product price list?

It seems a price list issue combined with the upgrade to 7.0 series.
On this version there is a new price field on the price list that must be filled to “List Price” to keep the previous behaviour. Here you have an screenshot with the value set:

Setting such field should probably fix the issue.

Also, it seems it could be this:

I tried this, but that did not help. So I guess I need to try @acaubet 's solution. Unluckily, advice is as sparse as these update information usually is. I do not know what to do with it. I can activate my VENV - but then?

PLEASE, fellow Trytonies - don’t forget us, the users. Or make clear that Tryton is for programmers only.

Thanks a lot, Wolf

I tried this, but the problem persists.

You don’t need to activate the venv to work with the database.
I’m assuming you have a postgres running, so you just need to:
psql database_name
and latter copy&paste the sql queries I posted on the migration.

PLEASE, fellow Trytonies - don’t forget us, the users.

You’ve got yourself to the milestone of setting up a Tryton, that means you have got to deal with database, clients connection, importing countries etc… at this point I’m assuming you are able to connect to your database and perform a query. It’s not about programming.

It’s not clear for me if you made the changes on the price list. Did you?

I have the ability (due to my ignorance) to tell you cracks what a user does not understand. I’m absolutely certain that all of you’re doing your best to provide good information. But we’re living in different worlds:

  • Yours is a deep understanding of what you’re doing.
  • Ours (we = users) is of copying commands into a prompt with (best case) a vague idea what we’re doing.

So - accept my offering to improve your info. I’m not blaming you - it’s just a message from another world.

NB: I’ll try your advice tomorrow.

Cheers,
Wolf

So I tried this:

$ psql [my_database] -U [database_user] -h localhost
Password for user [database_user]: 
psql (14.12 (Ubuntu 14.12-0ubuntu0.22.04.1), server 12.14 (Ubuntu 12.14-0ubuntu0.20.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

[my_database]=> update sale_line set quantity=null, actual_quantity=null, unit=null, product=null, unit_price=null where type != 'line';
UPDATE 4
[my_database]=> update purchase_line set quantity=null, actual_quantity=null, unit=null, product=null, product_supplier=null,delivery_date_edit=null, delivery_date_store=null, unit_price=null where type != 'line';
UPDATE 0
[my_database]=> exit

But the problem persists. Did I do it correctly?
What I noticed is that different “target parties” I’m changing to, do generate the same error message, but with different products.

Cheers,
Wolf

Still not clear for me if you tried the solution proposed by pokoli.

You need to have a value on the price list, this field is new, so you should set your preference:

Yes, I tried both of your suggestions. With some more testing, I found out that one of the two suggestions solved the problem for most products, but not for two, which I’m giving away for free, and therefore do have the price 0,00.

Could it be the case that @acaubet 's code needs some enhancement to cover this case?

Cheers,
Wolf

I don’t think so, my sql is more about wrong domain than wrong value.

My suspect is that you have something misconfigured on the price list, not just the field I talked about in my last post.

  • Maybe you are missing a final line on each price list that points to unit_price
  • Maybe the price list order of the line is causing that your match mixxin picks one line that does not have price before checking the product price.
1 Like

Thank you for this idea, which solved the problem. It worked without before - but good to know that it’s needed now.

Cheers,
Wolf

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.