Commit Graph
42 Commits
Author SHA1 Message Date
BVE 639ea1e362 [FIX] sale_coupon: Coupon mail sent twice
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

closes odoo/odoo#77095

X-original-commit: 1eb8cdec60a5f460f57669ce4336efbc5b0279c8
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-09-27 12:21:18 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Thibault Delavallée e9af609616 [IMP] mail, various: reorganize and lint composer action name
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
2021-08-18 13:35:07 +00:00
f57a13f3f6 [IMP] website: add the possibility to share coupon and promotion links
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

closes odoo/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>
2021-08-09 14:16:54 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
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.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
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

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Martin Trigaux 41d8b8cf68 [I18N] *: export saas-14.3 source terms
closes odoo/odoo#70673

X-original-commit: bcb9ff784e44462384b0a43a0a23eed7a1111bc5
Related: odoo/enterprise#18269
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-11 12:28:28 +00:00
Sunil Shrimali 424f7e96cb [IMP] coupon: adapt the changes from domain widget
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
2021-04-21 07:49:42 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
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>
2021-03-31 13:57:18 +02:00
nie 9588881b0e [FIX] sale_coupon: translate email subject and template
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

closes odoo/odoo#68366

X-original-commit: cb57e5dd9d850820f715b5ce4048c81f96b028b1
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-03-25 17:41:40 +00:00
Martin Trigaux 9741ef5ee6 [I18N] *: export saas-14.2 source terms
For odoo-master Transifex project, no demo data

closes odoo/odoo#66500

X-original-commit: 813931ac850e5ba4181259a5957ec72226fb670c
Related: odoo/enterprise#16510
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-19 08:02:58 +00:00
Nicolas Lempereur ec0fc57462 [FIX] sale_coupon: prevent program w/o company
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.

closes odoo/odoo#66231

X-original-commit: d260dddcdeddecd2bc0649d948f5e0cc30607e09
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-16 11:22:56 +00:00
Krupal Oza 71499bbd23 [FIX] sale_(coupon): Fix coupon reflection on invoice
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.

closes odoo/odoo#65845

Taskid: 2303244
X-original-commit: 98a3ca3274e9829666a773d5fe79f2e695524f51
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-02-09 19:33:28 +00:00
Michael Mattiello (mcm) 785b304876 [IMP] *: reduce shift in form views (xml)
* 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
2021-02-02 12:40:22 +00:00
Andrea Grazioso (agr-odoo) 0b96f51163 [FIX] coupon: printed coupon not properly displayed
Generate a coupon code, print it

opw-2444242

closes odoo/odoo#65118

X-original-commit: f88bc1b367fd30dac0d68f327ee07d16fa830a21
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-01-27 16:23:37 +00:00
Christophe Monniez 2949138a7d [IMP] various: use the barcode qweb widget whenever possible
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.

closes odoo/odoo#64211

Related: odoo/enterprise#15619
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-01-12 12:50:23 +00:00
nie a47143ed6e [FIX] coupon: public user cannot use promo code with edited rule
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

closes odoo/odoo#63822

X-original-commit: d31a86cead03623c375f4162324a6d1872cad6a3
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-12-28 11:09:22 +00:00
Andrea Grazioso (agr-odoo) d947b37767 [FIX] sale_coupon: select correct minimum amount with/without tax rule
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

closes odoo/odoo#63330

X-original-commit: 814cd954944b76fb8a8cb8e4b8da8d17c0eec88c
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-12-14 13:28:46 +00:00
Martin Trigaux 3f13751e9b [I18N] *: export saas-14.1 source terms
Without demo data

closes odoo/odoo#63238

X-original-commit: 4e6683973b1d1ecc67f1312a8ef98b1272e2d5a5
Related: odoo/enterprise#15268
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-12-11 12:30:42 +00:00
Adrian Torres 679185f3e8 [IMP] *: replace all raises inside unlink by api.ondelete
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
2020-12-04 09:16:16 +00:00
Martin Trigaux 1658473bf2 [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#62564

X-original-commit: 9b3b2e8d711e3be75b1faffaf6f4f8f4ec90186e
Related: odoo/enterprise#15038
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-30 07:07:58 +00:00
Hardik Prajapati 2e19c34b1f [FIX] coupon: domain selector visibility in modal
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.

closes odoo/odoo#59594

Taskid: 2225272
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-09 09:55:14 +00:00
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