When generating coupons for customers, the email was sent twice due to the values
given on the email_values that is generating a TO (email_to) value
(plus using the one given on the template (recipients_ids))
opw-2574046
closesodoo/odoo#77095
X-original-commit: 1eb8cdec60a5f460f57669ce4336efbc5b0279c8
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
In this commit some reorganization is performed within mail compose message
code. Purpose is to reorder a bit methods by main usage: onchange, CRUD,
actions, values generation with rendering and template management.
Some renaming is performed on action methods, notably send_mail that has some
impact on sub-addons. Finally we also set onchange and sub-onchange methods
private.
No functional change should be implied by this commit.
LINKS
Task ID-2377974
Community PR odoo/odoo#61467
Enterprise PR odoo/enterprise#14633
Coupons and promotion programs can now be shared by creating a link that can
directly be used by the customer.
Using the link, the system will try to apply the coupon/promotion to the
customer's order.
If this can't be done, the error will be shown to the user, for instance
"A minimum amount of 1000$ is required to get the free ipad".
That coupon/promotion will then be stored in session and the system will try
automatically reapply it when something is added to the cart.
task-2489749
closesodoo/odoo#69053
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Define `data-hotkey` on most used action buttons.
For the modals, the following keys are dedicated for "special"
actions:
- Alt+G: add
- Alt+V: save
- Alt+Z: cancel
closesodoo/odoo#73275
Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The domain field widget is now adapted to set visible overflow on modal if it
iss inline. With that changes, the custom controller for coupon generator is
not needed anymore.
With this commit, we remove the code related to custom controller
of coupon generator that used to set visible overflow on the modal.
Task ID-2480625
COM odoo/odoo#68586
Conversion of all modules to the new manifest assets declaration.
Part of task: 2352566
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
Steps:
- Install Sales
- Go to Settings / Translations / Languages
- Install Dutch
- Go to Settings / Users & Companies / Users
- Change demo's language to Dutch
- Go to Sales / Configuration / Settings
- Activate Coupons & Promotions
- Go to Sales / Products / Coupon Programs
- Create a new Coupon Program
- Click Generate Coupon
- Generation Type: Number of Selected Customers
- Matching rule: Name contains demo
- Generate
- Go to Settings / Technical / Email / Emails
- Open the email you just sent
Bug:
Parts of the email are not translated
Explanation:
The `lang` field is used to determine the template's language. Coupon
emails where missing one.
Also, the subject of the email wasn't translated.
opw:2467640
closesodoo/odoo#68366
X-original-commit: cb57e5dd9d850820f715b5ce4048c81f96b028b1
Signed-off-by: backspac <backspac@users.noreply.github.com>
For odoo-master Transifex project, no demo data
closesodoo/odoo#66500
X-original-commit: 813931ac850e5ba4181259a5957ec72226fb670c
Related: odoo/enterprise#16510
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The company is used to compute currency of:
- discount_fixed_amount
- discount_max_amount
- rule_minimum_amount
If currently we don't set a company, we have an error when using the
company.
opw-2458950
note: forward-port in master set the company field as required setting
it as required in the view.
closesodoo/odoo#66231
X-original-commit: d260dddcdeddecd2bc0649d948f5e0cc30607e09
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The purpose of this task is to reflect the coupon discount perfectly
from sale order to invoice. This issue is already fixed in 13.0 in
commit: bb5d999 but during refactor of coupon it was removed due to
module split.
So in this commit, improve the default invoicing policy of coupon product.
The default invoicing policy should always be by ordered quantity.
Otherwise, if the user changes the default invoicing policy to
"delivered quantity", coupon won't be applied to the invoice.
closesodoo/odoo#65845
Taskid: 2303244
X-original-commit: 98a3ca3274e9829666a773d5fe79f2e695524f51
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
* account, analytic, calendar, coupon, crm, crm_iap_lead_website,
delivery, digest, event, event_crm, fleet, gamification, hr,
hr_expense, hr_skills, im_livechat, lunch, mail, maintenance,
mass_mailing, membership, mrp, point_of_sale, pos_mercury, product,
purchase, purchase_requisition, sale_management, sales_team, sms,
stock, stock_landed_costs, survey, website_crm_partner_assign,
website_event_exhibitor, website_event_track, website_forum,
website_slides, base
This commit removes oe_edit_only labels and adds placeholder
on fields in form views from a lot of apps to minimize the
shift when switching mode.
task 2330101
When using the route `/report/barcode/...` in a report, wkhtmltopdf
makes htpps requests on the server to retrieve the barcode image.
If a lot of barcodes have to be printed, this can overload the server
with too much requests and makes wkhtml crashes.
With this commit, the qweb barcode widget is used to include the barcode
as an img tag with inline barcode image as base64 data.
closesodoo/odoo#64211
Related: odoo/enterprise#15619
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Steps:
- Install eCommerce
- Go to Website > Products > Promotion Programs
- Create a promotion program with a filter Based on Customers and a promotion code
- Save
- Edit the new program and clear the filter Based on Customers
- Save again
- Log out and go to the shop
- Add an article to your cart and click "View Cart"
- Click "I have a promo code"
- Apply the promo code you created earlier
Bug:
The promo code is not accepted.
Explanation:
When the filter Based on Customers is cleared, `[]` is written on the program rule. This makes the app search for a partner with id = 4 (Public User). Since this user is not active, the search returns no results and, therefore, forbids the user from using the promo code.
This works flawlessly when you create a promotion program with no filters as they are initialized with `NULL` and a `NULL` filter always returns `True`.
opw:2419796
closesodoo/odoo#63822
X-original-commit: d31a86cead03623c375f4162324a6d1872cad6a3
Signed-off-by: backspac <backspac@users.noreply.github.com>
Create a promotion program with the "Minimum Purchase Of" right field
left as blank
It won't be taken into account in SO when clicking on 'Promotions'
When the field is left as blank `rule_minimum_amount_tax_inclusion`
value is `False` and thus break the check.
opw-2392546
closesodoo/odoo#63330
X-original-commit: 814cd954944b76fb8a8cb8e4b8da8d17c0eec88c
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
Currently, when inline domain selector is inside the modal dialog
then the domain selector popover hide inside the modal body due to
auto scroll on modal body. domain selector in dialog is rare case and
here there is less content inside the coupon dialog due to that we can
use the overflow visible for this specific wizard(modal dialog).
So in this commit, fix the issues by adding overflow property in the
modal body due to that, it will always display on top of the modal.
closesodoo/odoo#59594
Taskid: 2225272
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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.