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.
Previously, in multiple modules, long names would result in an overflow of text.
With this commit long texts should appear like this: [aaaaa...] instead of
going out of their boxes.
Various views are updated, depending on which fields we wanted to prevent
from overflowing and the probability they do so.
Task ID-2325219
PR odoo/odoo#57713
PR odoo/enterprise#13226
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Although `coupon` is not a single app, when a user tries to install this
module alone, warnings are triggered because no access rules are defined.
Those warnings are pointing the fact that models without access rules
are a bad practice.
closesodoo/odoo#59293
X-original-commit: 801dbd09e217d316d9c048da3a7c4d6597cbc68b
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Including demo data this time
closesodoo/odoo#58862
X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Default on current environment language when there is no customer set on
the current coupon.
opw-2339815
note: part of this forward-port was not necessary because it was done in
98678199a3
X-original-commit: odoo/enterprise@d00981fe8fcloses#58473closesodoo/odoo#58734
X-original-commit: f1b9ebe57f37bcfb271e00a7e9ba15a45493bd73
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
On instances with a lot of coupons programs, performance issue arise while using eccommerce (adding item in basket ant opening it in particular).
In the client case, he have ~2000 of them.
Opening the basket with 1 product take:
Before this commit: ~10s
After this commit: ~2s
( pyflame is available in the ticket attachment )
`_get_valid_products` use the v13 `filtered_domain` method
Average execution time:
Before change: 0.001 s
After change: 0.0001 s
=> 10x times gained
The average execution time of `_is_valid_product` is 0.002 s (20 times slower than `_get_valid_products` for the same result).
=> All use of `_is_valid_product` were replaced by `_get_valid_products`
In this commit targeting master, we also completely remove
`_is_valid_product` as it effectively is no longer used and there are no
stable compatibility requirements.
OPW-2323599
closesodoo/odoo#56460
X-original-commit: c3a9738e25dbd773e3ee7c2175e62219346ef764
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
_("Foo %s", bar)
to progressively migrate the code to the new syntax.
A few calls were not technically incorrect but still detected by the
linter.
_("Foo" +
"Bar")
has been converted to
_("Foo"
"Bar")
as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).
closesodoo/odoo#53683
Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit sets attribute sample="1" in a bunch of list and
kanban views, to enable the new sample data feature when views are
empty.
Task 2232801
X-original-commit: 5471309b35619f307242c2704c7681ba63d2be42
Before this commit, We had two filters which filters Active/Inactive record were named as Opened/Closed.
In this commit, We remove those dummy filters and add `Archived` filter like all other search views.
closesodoo/odoo#46675
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Create a coupon program following these steps:
- Set name
- set 'Discount Apply On' to 'On Specific Product'
- Add specific product
- Set 'Apply Discount' to Fixed price
- Input the fixed price
- Save
Generate a coupon and try to apply it on a quotation.
Error will popup because Not all conditions are met.
The field discount_apply_on (invisible with fixed price) keep the
application "specific_products". Fixing by checking the values in the
backend.
opw-2257783
closesodoo/odoo#51574
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
... 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.