Tryton - Issues

 

Issue7718

Title Improve tax update from template
Priority bug Status testing
Superseder Nosy List Timitos, ced, pokoli, reviewbot
Type behavior Components account
Assigned To ced Keywords review
Reviews 54441002
View: 54441002

Created on 2018-09-21.22:27:51 by ced, last changed by reviewbot.

Messages
review54441002 updated at https://codereview.tryton.org/54441002/#ps1
msg44998 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-11-25.11:36:40
I do not think this should apply to tax code because it is not used a reference and it has the ActivePeriodMixin.
msg44016 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-09-21.22:27:51
With issue6013, we had to rework some taxes by removing children tax templates etc. Unfortunately when we remove the template, the instance is not removed when updating the chart from template. This is because the template Many2One is set with ondelete='SET NULL'. This is not very user-friendly as the taxes must be manually adapted.

I propose to set the ondelete to 'RESTRICT' and to add ActiveMixin on the template and tax (also for tax code). This way when updating the template from XML, it will fail to delete the template record (if used on an instance) so it will just deactivate it. The update chart from template will later update the active field to the instance.
History
Date User Action Args
2018-11-25 14:47:37reviewbotsetnosy: + reviewbot
messages: + msg45007
2018-11-25 14:26:07cedsetstatus: in-progress -> testing
reviews: 54441002
keyword: + review
2018-11-25 11:36:40cedsetstatus: unread -> in-progress
assignedto: ced
messages: + msg44998
2018-11-25 11:33:03cedsetpriority: feature -> bug
type: feature request -> behavior
2018-10-22 11:21:49pokolisetnosy: + pokoli
2018-09-22 08:32:07Timitossetnosy: + Timitos
2018-09-21 22:27:51cedcreate

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