Commit Graph
114 Commits
Author SHA1 Message Date
Christophe Simonis 5ac7557df2 [MERGE] forward port branch saas-11.3 up to a9f3cf76b93 2018-11-16 14:27:04 +01:00
Christophe Simonis 89ed115fe0 [MERGE] forward port branch 11.0 up to d2af0b13250 2018-11-15 20:41:29 +01:00
Christophe Simonis f89eef2b60 [MERGE] forward port branch saas-15 up to a267fcbdf62 2018-11-15 19:20:15 +01:00
Romain Derie 63131c2584 [FIX] sale_coupon: reset no more eligible applied coupon to Valid state
Before this commit:
When a coupon_program's coupon was giving a reward on a SO and then the
recompute was removing that reward (eg the SO did not met the requirements
anymore) the coupon would not be reset and would be lost.

Now:
If a coupon's reward got removed for some reason, the coupon got reset to a
valid state (`new`) so it can be used again.

Step to reproduce:
  - Generate a coupon from a coupon program that needs requirements (eg $300)
  - Add that coupon to a SO that has a total over $300
  - Coupon is set as `used` and the reward is granted
  - Remove some products to set the SO total below $300
  - Recompute coupon, the reward is correctly removed but the coupon is still
    set as `used` so it won't be usable again and is basically lost.

Closes #3062
2018-11-15 15:57:17 +01:00
Romain Derie 231669e332 [FIX] sale_coupon: remove coupon_program reward if req. not met anymore
Before this commit:
If a reward had been given on the SO with a coupon_program code and that the
program had requirements and that these requirements are not met anymore,
recomputing the SO would not remove the reward.

Now:
If the SO does not met the program requirements anymore, we remove the reward

Step to reproduce:
  - Create a coupon_program with quantity or amount requirements (eg: $200)
  - Generate a coupon for that program
  - Add $200 worth of products (matching the program domain) in the SO
  - Add the generated coupon to that SO
  - You should get the reward as you have $200 in the SO
  - Remove some products from the SO to go below $200
  - Recompute coupons, the reward won't be removed

Closes #3062
2018-11-15 15:57:12 +01:00
Romain Derie 5a75d1aeae [FIX] sale_coupon: unvalid next_order programs if needed
Before this commit:
We would never unvalid a `next_order` program (and thus it's generated coupon)

Now:
We also retrieve applied `next_order` programs as we need to check if they are
still valid too

Step to reproduce:
  - Create a program on `next_order` that require $300
  - Add $300 worth of product on a SO
  - Apply program, it will generate a coupon
  - Make the SO total go below $300
  - The generated coupon is still Valid and the client will receive that coupon
    even if it is not supposed to anymore

Closes #3062
2018-11-15 15:57:06 +01:00
Romain Derie e8efcb1bc3 [FIX] sale_coupon: do not deduce reward quantity on current_order
Before this commit:
1. We were checking if the rewards were in the SO even if it was 'next_order'
   program.
2. We were deducing the rewards quantity for 'next_order' program when checking
   if we had enough products to meet the program requirements.

Now:
1. We don't verify if the reward is on the SO if the program is 'next_order'
2. We don't deduce reward quantity when checking if enough products to meet the
   program requirements if the program is 'next_order'

opw-1907211
Closes #3062
2018-11-15 15:56:25 +01:00
Romain Derie 7b99c0db92 [FIX] sale_coupon: generate only one coupon per program per SO
Before this commit:
Everytime the SO met a 'on_next_order' program requirements, a coupon would be
generated on that SO. Even if there was already a coupon for that program set to
'expired', for instance when the SO did not met the requirements anymore.

Now:
When the requirements are met, it checks that an `expired` coupon does not
already exist.
It it does, it will set that coupon back to `reserved` state.

Step to reproduce:
  - Create a program on `next_order` with requirements, eg $300 amount
  - Create a SO and add $300 worth of products
  - Update promotion, a coupon is created and set to `reserved`
  - Now update the SO to go below $300
  - Update promotion, the coupon is set to `expired` as it should
  - Update again the SO to meet the $300 requirements again
  - Update promotion, a new `reserved` coupon is generated instead of updating
    the state of the previous one from `expired` to `reserved`

Closes #3062
2018-11-15 15:56:19 +01:00
Adrian Torres 51c7afff48 [FIX] sale_coupon: restore SO processing time
This optimizes the confirmation of a sale_order in the ecommerce by ~73%,
for a cart with 160 unique items, the processing time goes from
7m46s to 39s, which is roughly the same amount of processing time if the
module `sale_coupon` is not installed.

This optimization is achieved in two steps:

1. By validating promotional/discounted products in batch instead of
validating each product one at a time.

2. By performing an unlink() on invalid reward lines instead of sending
a delete command by writing to the one2many, as delete commands are not
(yet) performed in batch, which means record recomputation after every
delete.

opw-1893277
2018-11-15 15:56:14 +01:00
Christophe Simonis 251be0905b [MERGE] forward port branch saas-11.4 up to 590445ac4c1 2018-11-02 12:12:22 +01:00
Christophe Simonis b13d3b1357 [MERGE] forward port branch saas-11.3 up to 4bde063d914 2018-10-29 12:05:58 +01:00
Christophe Simonis 78d5941d50 [MERGE] forward port branch 11.0 up to aace8470b8e 2018-10-25 17:44:56 +02:00
Christophe Simonis eb902f8b39 [MERGE] forward port branch saas-11.4 up to 5999fd47c43 2018-10-23 15:18:46 +02:00
Adrian Torres c8d5ff55ff [FIX] sale_coupon: restore SO processing time
This optimizes the confirmation of a sale_order in the ecommerce by ~73%,
for a cart with 160 unique items, the processing time goes from
7m46s to 39s, which is roughly the same amount of processing time if the
module `sale_coupon` is not installed.

This optimization is achieved in two steps:

1. By validating promotional/discounted products in batch instead of
validating each product one at a time.

2. By performing an unlink() on invalid reward lines instead of sending
a delete command by writing to the one2many, as delete commands are not
(yet) performed in batch, which means record recomputation after every
delete.

opw-1893277

closes odoo/enterprise#2905
2018-10-23 06:57:50 +00:00
Christophe Simonis 94ae74a87a [MERGE] forward port branch saas-11.3 up to 793c90edd20 2018-10-19 14:48:58 +02:00
Christophe Simonis 9632d38f0a [MERGE] forward port branch 11.0 up to cba39ad6754 2018-10-19 12:27:00 +02:00
Christophe Simonis 879aef37f3 [MERGE] forward port branch saas-15 up to bff8b16f5d9 2018-10-18 17:16:57 +02:00
Goffin Simon 7633f96306 [FIX] sale_coupon: promotion program with fixed amount
Steps to reproduce the bug:

- Create a promotion program P with a fixed amount discount
- Set a customer tax T on the discount product generated for P
- Create a SO with one line
- Apply the promotion program by clicking on "Update promotions"

Bug:

The SO line with the discount product is generated but the tax T was missing.

opw:1888484
2018-10-17 15:24:33 +02:00
Christophe Simonis dbb575179f [MERGE] forward port branch saas-11.4 up to 8faebd0cf52 2018-10-01 20:17:14 +02:00
Christophe Simonis 4aed744934 [MERGE] forward port branch saas-11.3 up to 07444245de2 2018-10-01 14:01:11 +02:00
Christophe Simonis 3fc388c696 [MERGE] forward port branch 11.0 up to 92d7a5210d7 2018-10-01 10:46:29 +02:00
Christophe Simonis cfca60d422 [MERGE] forward port branch saas-15 up to ed3eff1427c 2018-09-28 19:17:34 +02:00
Romain Derie af0e47f42f [FIX] sale_coupon: compute fixed amount as such
Commit 092200073 broke the discount computation for discount of type
fixed_amount. Indeed the appropriate method was not called anymore and such
discount type would be computed as percentage discount with default value of
10% (field default for percentage).

opw-1888484
2018-09-28 18:14:10 +02:00
Christophe Simonis 47ef5cb2c0 [FIX] sale_coupon: correct sending of coupon via email 2018-09-28 13:43:36 +02:00
Adrian Torres 67431fcfaa [REF] *: adapt code to new related default behaviour
This commit adapts the business code to changes introduced by
the change to related field's default readonly value in order to
keep the same behaviour as before.

All readonly=False fields will have to be checked afterwards to confirm
that the business case requires write access to the source field.
2018-09-27 12:09:45 +02:00
Christophe Simonis a17ddde9a1 [MERGE] forward port branch 11.0 up to 1e8ab568c1f 2018-09-26 20:02:37 +02:00
Christophe Simonis 6b5aadc7ce [MERGE] forward port branch saas-15 up to c74e1ae51a8
closes odoo/enterprise#2707
2018-09-22 19:41:40 +00:00
Romain Derie 602b48eeba [FIX] (website_)sale_coupon: fix website dependence in sale_coupon
67c3de295e9 wrongly adapt coupon to multi-websites as website references should
have been written in website_sale_coupon and not sale_coupon.

Closes #2673
2018-09-18 12:09:17 +02:00
Romain Derie 85c89c300a [FIX] sale_coupon: dont show strikethrough if pricelist show discount
Using a pricelist set as `without_discount` will show a strikethrough price on
reward line (discount and free product).
This is happening because the program reward line (discount_line_product_id) is
created with the default 1$ price as this price is not usefull when computing
coupons. Only the line price is checked.

Now, we create a reward line with a -1 000 000$ price to prevent this UI
behavior.

Step to reproduce:
  - Activate pricelist (Sales>Config>Settings>Pricelist formulas)
  - Activate discounts in Sales Configuration (Manual discount on order lines)
  - Set pricelist to 'Show public price & discount to the customer'
  - Add a discount in your cart
  - There in a strikethrough price of $1 above the discount line price

task-1878245
2018-09-13 15:21:51 +02:00
Romain Derie 452e906396 [FIX] (website_)sale_coupon: _compute_tax_id with tax on reward line
It should get tax from the SOL and not the SO's product as the tax is applied
on the SOL only (the reward product has no tax by default).
2018-09-13 15:20:40 +02:00
Romain Derie 5ff0b842df [FIX] sale_coupon: delete 'sibling' lines when deleting a reward line
A discount on products with different taxes will result in as many discount
lines as there is different taxes.

Before this commit, removing one of these lines would not do anything else.
Then, recomputing the coupon would regenerate/add back this line.
On e-commerce, it means you would never be able to remove the program by
deleting its reward lines if there are multiple taxes (and so multiple lines)
since it would `recompute_coupon_lines` right away, adding it back directly.

Now, this commit will ensure that removing one of these lines will also remove
the other ones coming from this program on other taxes.
It means removing a regular product will remove it's reward line that will also
now remove the other program's discount line on other taxes and ultimately will
remove the program from the SO since all the program reward lines got removed.
(It won't affect auto applied program since it will be regenerated afterward)

task-1866977
Related to #2224
2018-09-13 15:16:57 +02:00
Romain Derie 034fb31c40 [FIX] sale_coupon(_delivery): fix some flows (mostly on next order)
This commit is the continuity of a42c27f9 that fixed some bugs.
One of the bug was that a discount was only applied on price without taxes.
E.G: A $100 product with 20% excluded tax would cost $120 but a 50% discount
     would give the user only $50 discount and not $60 as expected.
     User would lose $10 discount.
With these fixes, the discount line would correctly be set to $60 but since the
discount line would not have tax, the merchant would lose the discount amount
on the tax, in this case 50% of $20.

This commit will improve this case by adding a tax on a discount line.
Thus, since a global discount can be applied to multiple products having
different taxes or even multiple taxes on the same product, a discount line
should be split for every product taxes the discount applies on.
Obviously, this is a big behavior change, even if the discount is now finally
correct: the discount is applied on the total price and the merchant does not
lose any taxes.

To make it more clear, the discount lines description will mention on which
taxes it is applied.

There won't be any changes in the e-commerce since we will group the discount
lines so it will appear as before even if there are multiple lines. This is
only possible because we don't show taxes on line on the e-commerce.

This commit also fixes more complex flows/use cases.
Note: Fixes & flows will be illustrated with a SO but the behavior is the
      same with a cart on front-end.

== Fixes ==
===========================================================================
The biggest flow that needed to be fixed is when a promotion program give a
reward on the next order.
Let's illustrate with a promotion program giving a free `product_B` on next
order (so it will generate a coupon) if the SO meets the requirements.
The requirements are: buy a `product_A` and buy for at least $600.
(This program needs a code: 'free_b_on_next')

1. If the SO has a `product_A` and over $600, applying the promotion code
   `free_b_on_next` will error saying that `product_B` is not in the cart.
   This error should not appear, since the `product_B` is the reward for
   the next sale order that will use the generated coupon.

Anyway, if you add `product_B` and apply the promotion code `free_b_on_next`
to generate the coupon to check the rest of the flow. It will generate the
coupon and send email to the customer.

2. Every time you will apply the promotion code `free_b_on_next`, it will
   regenerate a new coupon and resend a new email to the client.

Then, create a second SO, add 2 `product_B` and try to apply the generated
coupon from the first SO.

3. It will error saying that the $600 requirement is not met.
   It should not since the requirement was only required to generate the
   coupon on the first SO. User has now a coupon to enjoy a free `product_B`
   and should not buy $600.

Anyway, let's add some products to meet the 600$ requirement to check the rest
of the flow.

4. It will now error saying that `product_A` is not in the cart.
   As bug 3., it should not since this requirement was also required to
   generate the coupon on the first SO.

Anyway, let's add `product_A` to meet the requirement to check the rest of the
flow.

5. Updating the promotions will remove the reward and you won't be able to
   reapply the coupon since it was `used`.
   This bug was even more critical in front-end since any action on the cart
   will recompute the coupons and automatically delete the reward after adding
   it. The customer never saw the reward on his cart.
   This bug is related to 3. and 4. Indeed, when recomputing coupons, it will
   remove programs that are not applicable anymore. The code wrongly think it is
   the case with this coupon since we don't have $600 or a `product_A`.
   `_remove_invalid_reward_lines` should treat coupon coming from a promotion
   program set on `next_order` differently and not filter on requirements.
===========================================================================

6. (extension of 2.) Every time an user would meet the requirements of a
   promotion program generating a coupon for a next order, it would generate a
   coupon and send an email.
   E.g: If buy 2 iPads get 1 for free on next order. If user add and remove iPad
        for some reason, every time he has 2 iPads in his cart it will receive
        an email with a new coupon.

6'. When applying a promotion code that will reward next order, it will not be
    set in the SO `code_promo_program_id` (I did not change that behavior since
    it could make sense to be able to apply another coupon that will give -20%
    on current order).
    This will allow applying multiple promotion rewarding a next order and/or a
    promotion rewarding current order. (Which would not be possible if was
    stored on `code_promo_program_id` since you can only apply one code on an
    order)
    But this cause a bug: since the promotion program is not stored on the order,
    every time you will apply the coupon it will generate a new coupon and send
    an email.
    So if you work on a draft sale order and do some tests, it will send many
    emails to customer..

7. Having multiple global discounts (on the whole SO) was forbidden: you can't
   apply a coupon promotion or a program promotion if there is already a global
   coupon discount or a global promotion discount with code. But still you could
   apply a global discount if there were a global promotion discount automatically
   applied (without a code).

8. On the generate coupon wizard, if you select `Number of Selected Customers`,
   by default it is set to 'Match all records (X records)'.
   But when you click on generate, it won't generate anything even if visually
   it selected every partner by default.
   This is because the domain default value is an empty string. Thus, the domain
   widget is selecting everything but once it is sent back to the server, since
   it's an empty string it won't get through the `if` condition.
   It was even weirder when you add something to the domain and remove it, you
   then visually come back to where you were at the beginning but the domain got
   changed from '' to '[]' so in this case it will generate the coupon for every
   partner.

== More like improvements ==

1. `action_cancel` and `action_confirm` would handle correctly the states of the
   applied and generated coupons (valid, consumed, expired..).
   But `action_draft` would not handle the states at all.

2. The generated coupon on a SO are now sent by email only when the SO is validated.
   This is part of the fix n°2 on coupon being generated multiple times and sent by
   email multiple times.
   The coupon sent by email was not usable anyway since it would error saying the
   SO that generated the coupon was not validated.

3. Discount line limited to a max amount (set in the program) will mention on
   the line description that the discount is limited.
   This will avoid cases where you don't understand why 50% discount of $2000
   SO shows $40.

4. If you archive a program and there is still some SO containing this program's
   reward line, these line will be 'floating free' and will never be updated or
   removed. Indeed, the `_remove_invalid_reward_lines` is basically checking
   which programs could be applied on the order and which one are applied on the
   order. If a program is applied on the order but is not supposed to, his
   reward line will be removed.
   Of course, since the program got archived, it won't get retrieve and the line
   will never get removed. Even if the case of a free iPad: if you buy an iPad
   and you removed the paid iPad from the SO. The free iPad will remain forever.
   Note: We can't remove these discount line directly when archiving a program
         because there might be quotations that we don't want to modify since it
         is waiting for customer confirmation.

Improved behavior:
  - Archiving a program archives its related reward product but unarchiving
    the program does not unarchived the product.

task-1866977

opw-1832967
opw-1857843

Closes #2224
Comes with https://github.com/odoo/odoo/pull/24971
2018-09-13 15:16:57 +02:00
Romain Derie d228005ec4 [IMP] sale_coupon: adapt to multi-websites
This commit adds the `website.multi.mixin` to coupon program to make it
multi-websites.

It also adds the website_id field in the views and adapt SQL constraint on code
which now became multi-websites friendly.
2018-09-02 15:27:05 +02:00
Martin Trigaux 3c934fa520 [REF] *: use native date/datetime for Date/Datetime fields
This commit adapts enterprise code to rev. 960360afe4

Task-ID: 47189
2018-08-06 14:39:58 +02:00
Ravi Gadhia efa70274cf [IMP] various: improve section and add note on sale order and invoice
Enterprise counterpart of this commit: https://github.com/odoo/odoo/commit/762adedece1c6c2b97b282348659c1b39b988d24

In enterprise the commit will also remove most of the features of website_quote_subscription because they became obsolete with the ability to create sections.

Indeed the feature was to automatically regroup recurring subscriptions in a "section" at the bottom of the documents. Now if the sale persons want that behavior they can just create an actual section.

Task #53996
PR #2276
2018-07-17 13:13:15 +02:00
Yannick Tivisse 977e1dfe66 [IMP] product,...: Improve demo data
* Update demo data sheet for barcode
* Modify product "Book: Office Renovation for Dummies:
    - Name: "eBook: Office Renovation for Dummies"
    - Image:
    - Internal category: All/Services/Saleable
* Tips internal reference
* Product 10.0 % Discount =
    - Name : "10.0% discount on total amount" (no space between 0 and %)
    - Internal reference : 10PERCENTDISC
* Free product - large cabinet
    - Should be a stockable
    - in category All/Saleable/Office Furniture
    - Name : Free Gift - Pencil Holder
    - Picture
* Desk Customizable :
    - Change its website sequence (should be displayed first in the shop)
* https://github.com/odoo/odoo/pull/25263
* Need to clean attributes and attribute values and attribute categories :
    - Attributes, keep : Brand, Color, Dimensions, Legs, Weight
    - Attribute Category : Rename Storage into "Material"
* Events
    - Suppress Functional Webinar and Technical Training
* PoS Categories :
    - Suppress
    - Create PoS Category : Desks (put desks in it)
    - Create PoS Category : Chairs (put chairs in it)
    - Create PoS Category : Miscellaneous (and put all other products in it)
* Products available in PoS
    - Remove : Air Flight, Car Travel Expense, Bpost domestic bpack 24h pro, Bpost World Express Pro, Customer Care, DHL USA Delivery, DHL USA -> International, Deposit, Expenses, Fdex International, Fedexs US, Hotel Accomodation, Restaurant Expenses,
* Product:
    https://drive.google.com/a/odoo.com/file/d/1KjxcB88aDfe8qAzIpFlkBmMj5ekA9eIf/view?usp=drivesdk
    Timesheet : description to update https://docs.google.com/spreadsheets/d/1nB8l8pFcRXRFnudgDJVyZZp3McaHNovlyvY0jE1ZZ54/edit?usp=sharing
* Project : less projects, more tasks
    Remove "Internal - GAP Analysis", "Internal Projects"
    Rename Support into After-Sales Services
    Task to rename: Data import + Doc ==> Office planning
    Move the task Internal Training from "Support" to "Office Design"
* AGR Project : add the following tasks and link it to the right SO line
    Decoration : SO Line ==> Senior Architect
    Planning :  SO Line ==> Senior Architect
    Furniture  SO Line ==> Senior Architect
    Furniture Delivery : not linked to an SO line
* Marketing Automation
    Partnership offer ==> to rename into "Commercial prospection"
    Steps to rename:
        Offer free trial ==> Offer free catalog
        After 7 days (if not yet partners) ==> After 7 days (if not yet customers)
    Message for sale person ==> keep the same
* Mass mailings:
    http://nimb.ws/zrKsZ9
    http://nimb.ws/CbNpwd
* Events:
    Suppress Functional Webinar and Technical Training
    Tracks to update : https://docs.google.com/spreadsheets/d/1sKkJrltXY3Gz7ue3mVysZxaWGybKpx5fIhgUBnhbNDs/edit?usp=sharing
* Helpdesk
    Rename team into Customer Care
    Create 2 tickets in default team
    Urgent : Kitchen collapsing (assigned to admin) : link to the task  SO053: [SERV_585189] Customer Care (Prepaid Hours)
    No pririoty : Where can I download a catalog ? (not assigned).  Ticket type = question
2018-07-12 13:45:10 +02:00
Pratima Gupta e1467490e0 [IMP] sale_coupon: make email templates bioutifoul
Purpose of this commit is to enhance quality of templates proposed by Odoo
and make them use notification layout when send by emails. Those emails
are cleaner and more up to date compared to other emails.

Including
  * revamping of coupon email to match current notification guidelines. It
    was using a very strange and different design. We choose to standardize
    it;
  * use the light notification template to encapsulate coupon emails when
    sending them by email;

This commit is related to task ID 51122 (and PR #2060).
2018-06-08 17:11:54 +02:00
Christophe Simonis 417e15ff39 [MERGE] forward port branch saas-11.3 up to 7636a83eb68 2018-04-17 16:24:44 +02:00
Christophe Simonis 8801177bf1 [MERGE] forward port branch saas-11.2 up to dd571e88f7c 2018-04-16 19:56:43 +02:00
Christophe Simonis f1b8b48844 [MERGE] forward port branch 11.0 up to 620fdfe51ba 2018-04-16 19:00:22 +02:00
Yannick Tivisse 96cc6c3875 [IMP] *: Replace all occurences of 'compute' by '_convert' 2018-04-13 17:02:48 +02:00
Christophe Simonis dc06f0e4bf [MERGE] forward port branch saas-15 up to 7d49f2f192c 2018-03-29 18:47:19 +02:00
Romain Derie 0a565abfad [FIX] sale_coupon(_delivery): correct discount when specific product
Before this commit:
1. With a coupon set on 'specific_product', the discount amount was multiplied
   by the product quantity twice.
   (Introduced by a42c27f which apply discount on the full price by using
   price_total (already multiplied by quantity) over price_unit.
2. With a coupon set on 'cheapest_product', the discount was not discounting taxes.
3. With a coupon set on 'cheapest_product' and `sale_coupon_delivery` installed, it
   would simply crashes and throws an error since `sale.order.line` has no
   `program_id` attribute.

Now:
1. We no longer multiply by the quantity twice;
2. We apply discount on the full price (with taxes);
3. We use correct attribute to avoid crash.

opw-1830986
2018-03-29 13:14:06 +02:00
Christophe Simonis 7b5b3ea96d [MERGE] forward port branch saas-11.2 up to e1a2b299b23 2018-03-23 16:21:58 +01:00
Christophe Simonis e06f3b0b3b [MERGE] forward port branch 11.0 up to 8d011f0a263 2018-03-23 10:39:53 +01:00
Christophe Simonis a19d5ba42c [MERGE] forward port branch saas-15 up to 2e0ad761de8 2018-03-21 14:55:32 +01:00
Romain Derie b6eb3a871b [FIX] sale_coupon: don't recompute coupon when confirming a quote
Before this commit:
When you 'CONFIRM SALE', it would recompute the coupons just before
confirming the quote.

This would cause 2 issues:
1. You had no way to know what the generated SO will looks like (maybe unless
   you know perfectly all the coupon promotions?).
   You would end up with a 'surprise' SO that could be totally different from
   the quote you just confirmed.
2. You had no way to cancel or prevent a coupon to be applied even if you
   wanted to.
   Eg: you don't wan't to offer this free forth iPad or this 10% discount to
   that customer or this week.

Obviously, you could set all your coupons to be used with a code so the
recompute won't add any coupon to the quote but that would not make sense since
you would be limited to one coupon per SO.

At the end, there is a `UPDATE PROMOTIONS` on the quote which it's only purpose
is to recompute the coupons. The good practice would be to use that button
instead of using the confirm quote step to recompute the coupons.

Comes from #1967 (see review comment)
2018-03-19 11:03:37 +01:00
Romain Derie 61d049ab4c [FIX] sale_coupon: recompute coupon before confirmation
Instead of after
If "Lock Confirmed Orders" option is checked, a sale order with a coupon can not
be confirmed as the lines are recomputed after the change of state

Backport of https://github.com/odoo/enterprise/commit/073ca5866a3a7006a03b99c4681e60da7a6e6efd

Closes #1967
2018-03-16 11:14:12 +01:00
Christophe Matthieu ce054681f0 [FIX] sale_coupon: change unit
When the reward product is changed, the corresponding UOM should be
adapted.

opw-1823149
2018-03-13 15:47:56 +01:00
Christophe Matthieu 75f39e07b2 [FIX] sale_coupon: can duplicate sale order lines
Fix the commit a42c27f99e0061b7c4f6597e4 which inverts the initial
filter. The change remove all sale order lines for the simple order
create in the backend.

opw-1819977
2018-03-13 12:53:31 +01:00