summaryrefslogtreecommitdiff
path: root/addons/auth_signup/controllers/main.py
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-01-05 16:02:35 +0100
committerDenis Ledoux <dle@odoo.com>2016-01-05 16:21:06 +0100
commitc043025e5d765a8ca49d88b7cbff37ecff8657bc (patch)
treeae539a36feb24c3e35e4cf1b7bffd0764402ae25 /addons/auth_signup/controllers/main.py
parent6c9a874635a12bd83e5d225cabf045260526a796 (diff)
[FIX] event_sale: prevent useless write on the product
`event_sale` adds an onchange on the `product_id` of the sale order lines, which returns values for the fields `event_type_id` & `event_ok`, which are used for an attrs domain on the fields `event_id` & `event_ticket_id` in the sale order line form (dialog). `event_type_id` & `event_ok` are related to `product.product` fields, in addition. Changing the partner of the sale order triggers the onchange on the lines, which triggers the onchange of the `product_id`. As these two fields `event_type_id` & `event_ok` were not in the sale order lines tree view, as readonly, they were passed to the write operation when saving the SO, therefore writing on the product (the same value than before, in addition). Indeed, if an onchange returns values for fields that are reandonly in the view, these are ignored when saving/writing. However, if the onchange returns values for fields that are not in the view, these values are nevertheless passed to the write operation, even if there was actually no change. This behavior should probably change, that if an onchange returns values for fields that are not in the view, these are ignored, either when saving the record, either when returning the result of the onchange. Either way, these are risky changes, that we prefer to avoid in a stable release such as 9.0. As a workaround, we therefore add these fields in the sale order line tree view, as readonly, so they are properly ignored when saving the record. This is important to avoid this write on `product.product`, as users can have the write access to the `sale.order` without having access to the `product.product` (e.g. `Sales > See own leads` group) opw-660716
Diffstat (limited to 'addons/auth_signup/controllers/main.py')
0 files changed, 0 insertions, 0 deletions