Commit Graph
19 Commits
Author SHA1 Message Date
Joseph Caburnay 0f50dd33d0 [FIX] *_coupon: introduce total_order_count as replacement to get_total_order_count()
closes odoo/odoo#40325

Related: odoo/upgrade#1869
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-11-04 10:34:34 +00:00
Joseph Caburnay e9583cccdd [FIX] *_coupon: use get_total_order_count() on checking maximum_use_number 2020-11-04 08:13:15 +00:00
Joseph Caburnay 4d59d3d1f3 [REF][FIX] coupon,sale_coupon: move mail_template_sale_coupon
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.
2020-11-03 10:48:04 +00:00
Joseph Caburnay 54c42ae836 [ADD] pos_coupon: allow the use of promo and coupon programs in pos 2020-11-03 10:48:03 +00:00
Joseph Caburnay c8c5ff2753 [FIX] coupon: validity_duration not visible in on_next_order program
Since the promo programs with on_next_order promo_applicability generate
coupons, the validity_duration field should be visible and editable.
2020-11-03 10:04:23 +00:00
Pedro (pno) a0ebb46098 [FIX] {base, coupon, crm, event, mass_mailing, product, project, sales_team, utm, web}: prevent long texts from overflowing
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>
2020-11-04 07:32:27 +00:00
Christophe Monniez 46936dc28c [FIX] coupon: add basic access rules
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.

closes odoo/odoo#59293

X-original-commit: 801dbd09e217d316d9c048da3a7c4d6597cbc68b
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-10-06 14:30:00 +00:00
Martin Trigaux e79531c136 [I18N] *: export 14.0 source terms
Including demo data this time

closes odoo/odoo#58862

X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-29 17:52:02 +00:00
Nicolas Lempereur 00e7122a40 [FIX] sale_coupon: sale_coupon default current lang
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@d00981fe8f
closes #58473

closes odoo/odoo#58734

X-original-commit: f1b9ebe57f37bcfb271e00a7e9ba15a45493bd73
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-09-28 17:32:08 +00:00
Martin Trigaux 90d85eb9c5 [I18N] export saas-13.5 source terms
Without demo data

closes odoo/odoo#56869

X-original-commit: 33f251b6489455cd7221f2c62dee0400a69784b8
Related: odoo/enterprise#12836
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-01 11:18:00 +00:00
Loan (lse) 54c74bb433 [FIX] sale_coupon: Better performance
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

closes odoo/odoo#56460

X-original-commit: c3a9738e25dbd773e3ee7c2175e62219346ef764
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-08-25 08:08:47 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
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).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
Jérémy Hennecart 9389f7ce2e [IMP] *: enable sample data in several views
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
2020-06-22 13:04:02 +00:00
Swapnesh Shah e34689411c [IMP] sale_coupon: Add Archived filter
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.

closes odoo/odoo#46675

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-05-28 18:52:18 +00:00
Andrea Grazioso (agr-odoo) 8eefb69252 [FIX] sale_coupon: correct discount application values from view
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

closes odoo/odoo#51574

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-25 07:44:35 +00:00
Baptiste Vergote e3be55d3f6 [FIX] sale_coupon: send mail template to partner of SO
... 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

closes odoo/odoo#51570

X-original-commit: f7e0c2d1568b222d510d3a10fba1116fabfff604
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-19 16:44:39 +00:00
Joseph Caburnay afad149eb8 [REF] *_sale_coupon: create coupon module
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.
2020-05-08 14:27:29 +00:00
Joseph Caburnay ef05ca2812 [REF] sale_coupon: rename/move files to prepare coupon module
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.
2020-05-08 14:25:54 +00:00