Skip to content

Commit

Permalink
[FIX] sale_coupon: Delete Coupons on deleting Related Program
Browse files Browse the repository at this point in the history
There is no Point to Keep Coupons which is not linked to any Coupon Program.

closes odoo#46673

Signed-off-by: Jérémy Kersten (jke) <[email protected]>
  • Loading branch information
sswapnesh committed Mar 2, 2020
1 parent 86726ab commit 870eb3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/sale_coupon/models/sale_coupon.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _generate_code(self):
('expired', 'Expired')
], required=True, default='new')
partner_id = fields.Many2one('res.partner', "For Customer")
program_id = fields.Many2one('sale.coupon.program', "Program")
program_id = fields.Many2one('sale.coupon.program', "Program", required=True, ondelete="cascade")
order_id = fields.Many2one('sale.order', 'Order Reference', readonly=True,
help="The sales order from which coupon is generated")
sales_order_id = fields.Many2one('sale.order', 'Applied on order', readonly=True,
Expand Down

0 comments on commit 870eb3f

Please sign in to comment.