Tryton - Issues

 

Issue6499

Title Set sale/purchase uom when activating a product for sale/purchase
Priority feature Status invalid
Superseder Nosy List ced, pokoli, reviewbot
Type feature request Components purchase, sale
Assigned To pokoli Keywords review
Reviews 40341002, 34971002
View: 40341002, 34971002

Created on 2017-05-10.15:46:52 by pokoli, last changed by pokoli.

Messages
review40341002 updated at https://codereview.tryton.org/40341002/#ps20001
review34971002 updated at https://codereview.tryton.org/34971002/#ps20001
msg33691 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-05-18.10:50:26
I do not think the sale/purchase uom should be changed when salable/purchasable is changed.

No on_change_with is not a correct design because those uom should only be modified when the default uom is changed to something not compatible.
msg33690 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-05-18.10:45:57
Yes, but this code is not triggered when the salable flag is set/unset, so it does not work for all the cases. 

After a second though I think we should convert the current code to an on_change_with function to ensure that the same code is always run.
msg33688 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-05-18.08:43:58
Indeed there is already code when changing the default uom in both module.
I do not think we must add more code.
New review34971002 at https://codereview.tryton.org/34971002/#ps1
New review40341002 at https://codereview.tryton.org/40341002/#ps1
msg33619 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-05-10.15:46:52
When marking and existing product as salable, thee sale uom is empty and the user is forced to manually enter one. On the other hand, if you set the default_uom of a salable product, this uom is used as sale uom. 

For consistency I think that the default_uom should be set as sale_uom when marking the salable field. 

The same applies for purchase.
History
Date User Action Args
2017-05-30 12:44:08pokolisetstatus: testing -> invalid
2017-05-18 11:01:54reviewbotsetmessages: + msg33694
2017-05-18 11:01:50reviewbotsetmessages: + msg33693
2017-05-18 10:50:26cedsetmessages: + msg33691
2017-05-18 10:45:57pokolisetmessages: + msg33690
2017-05-18 08:43:58cedsetnosy: + ced
messages: + msg33688
2017-05-10 16:10:30pokolisetstatus: in-progress -> testing
2017-05-10 16:02:08reviewbotsetmessages: + msg33622
2017-05-10 16:02:07reviewbotsetreviews: 40341002 -> 40341002, 34971002
2017-05-10 16:02:04reviewbotsetnosy: + reviewbot
messages: + msg33621

Showing 10 items. Show all history (warning: this could be VERY long)