When archive a loyalty program which have somes rules and rewards and the unarchinving it will not have the rules and
rewards that it had before.
Steps to reproduce the error :
1- install sales
2- activate Discounts, Loyalty & Gift Card in sales settings
3- go to sales/products/Discount&loaylty
4- select one of the default programs and try to archive it and unarchive it after
5- you will not get the rules that it had before
The problem was in the toggle_active function of the loyalty program we try to unarchive already unarchived items because
we do ```program.rule_ids``` so it will get only active items.
opw-3299295
closesodoo/odoo#121710
X-original-commit: 1d9fbda1c5ec69ba83968668ddecec6a7e1421bb
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
Before this commit when choosing the program rule type "Buy X get Y"
an error occured: after adding rewards and trying to save the record
the rewards were reset to the default value for program rules
of type "discount".
This ocurred because the program type was not being sent to the
`default_get` method of the `loyalty.reward` record.
After this commit rewards are correctly preserved.
opw - 3240558
closesodoo/odoo#118679
X-original-commit: 44b9eab482a219e6c260ef29512b8d6a595300ac
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This module is an unification of `coupon`, `gift_card` and an extraction
of the program models of `pos_loyalty`.
The goal of this module is to unify the creation of coupon, promotion,
gift_card, loyalty programs etc.. into a single base module and share
the same models.
Managers will be able to create programs based on rules and rewards.
Programs may apply on the current order (rules and rewards)
or on future orders, where the rules must match the first order to get a
reward on the second order
or even be nominative and accumulate points over multiple orders.
Every program is based on a point system. And each use of the program
will result in the creation of a coupon (except for nominative programs
which should be limited to one card per customer).
A rule may filter on quantity, money spent and products and give points
on the order, the amount of units paid or the amount of money spent.
A reward could be a free product, a discount or (with an additional
module) free shipping.
Discounts can be percentage based, fixed, or based on the amount of
points the card has.
They can also be filtered on products or tags, to discount specific
products.
A new feature is also being able to select communication plan for these
programs.
The manager can define a template to be sent upon the creation of a new
coupon/card or when reaching a certain amount of points.
TaskId-2675382
For empty list design:
Co-authored-by: Carlos Valverde <cvs@odoo.com>