Module
purchase_triple_discount
Describe the bug
In the write method of the triple_discount_mixin model, when modifying any of the discount fields (discount1, discount2, discount3), the calculated value is correctly assigned to the discount field. However, upon saving the purchase order, the values of discount2 and discount3 are reset to 0, and the calculated discount value is copied into discount1. This is not the expected behavior; the values of discount1, discount2, and discount3 should remain unchanged, and only the discount field should be updated with the calculated value.
To Reproduce
Affected versions:
- Odoo 16.0 CE
- purchase_triple_discount 16.0
Steps to reproduce the behavior:
- Create a purchase order.
- Add a line item with values in the
discount1, discount2, and discount3 fields.
- Save the purchase order.
- Observe that:
- The
discount field is correctly calculated.
- The values of
discount2 and discount3 are reset to 0.
- The calculated
discount value is copied into discount1.
Expected behavior
- The values of
discount1, discount2, and discount3 should remain unchanged.
- Only the
discount field should be updated with the calculated value.
Additional context
- No errors observed in the browser console.
- The issue persists across different browsers and operating systems.
Module
purchase_triple_discount
Describe the bug
In the
writemethod of thetriple_discount_mixinmodel, when modifying any of the discount fields (discount1,discount2,discount3), the calculated value is correctly assigned to thediscountfield. However, upon saving the purchase order, the values ofdiscount2anddiscount3are reset to 0, and the calculateddiscountvalue is copied intodiscount1. This is not the expected behavior; the values ofdiscount1,discount2, anddiscount3should remain unchanged, and only thediscountfield should be updated with the calculated value.To Reproduce
Affected versions:
Steps to reproduce the behavior:
discount1,discount2, anddiscount3fields.discountfield is correctly calculated.discount2anddiscount3are reset to 0.discountvalue is copied intodiscount1.Expected behavior
discount1,discount2, anddiscount3should remain unchanged.discountfield should be updated with the calculated value.Additional context