mail_template_sale_coupon is specific to sale_coupon so we are moving
it back to sale_coupon module. Additionally, we add a way of selecting
a mail template when generating coupons for customers.
... instead of public user
Once sending the template email Coupon: Send by Email.
Odoo was sending to the partner linked to the sale.coupon
However in the case of the program having the parameters:
apply on next order & apply automatically.
The partner_id.id is the public user.
This commit is modifying the value of the template to send
the email to the partner of the SO instead of the partner
of the current coupon.
opw-2255674
closesodoo/odoo#51570
X-original-commit: f7e0c2d1568b222d510d3a10fba1116fabfff604
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This refactoring extracts parts of `sale_coupon` module to create a more
generic module called `coupon`. This new module can be extended in
different sales modules to implement functionalities specific to modules
that extend it.
An initial step to prepare the creation of coupon module. The main goal
is to just move the logic from sale_coupon to coupon. To come up with
less diff as possible, this rename/move step is beneficial for this
purpose.