Commit Graph
136 Commits
Author SHA1 Message Date
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
Fabien Pinckaers b62ebab586 [IMP] product: Unify/Clean product demo data
PURPOSE
=======

1. Unified product demo data
2. Less demo: one per use case
3. Demo data for all models

Specification
=============

1. Refactor all the brol in the demo data
2. Adapt the tests to make them green, as some products are
   renamed, removed, created in python instead of as demo data
   ...
2018-07-05 08:59:55 +02:00
kujiu 33f0e8a4ff [IMP] Improve compatibility with screen readers (accessibility) (#2146)
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.

This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.

* [IMP] Labels must have a for attribute. Improve accessibility.
* [FIX] Update some title attributes for a11y.
* [IMP] Add aria-labels
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views
* [IMP] Add 'alt' attribute on 'img' tags
* [IMP] Add aria-label and title on icons.
* [IMP] Add dialog role on modals.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add role on alerts
* [IMP] Add role="button" on simili buttons
* [IMP] Use dialog role, header, main and footer tags for modals
* [FIX] Set all tabs aria-selected since we don't have proper script to set the attribute correctly.
* [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-22 21:27:40 +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
Christophe Simonis f040553c81 [MERGE] forward port branch saas-14 up to 42ff51b2dd9 2018-03-29 17:56:55 +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
Christophe Simonis b4ada5bf6a [MERGE] forward port branch saas-14 up to 3c16040ebf9 2018-03-21 11:21:52 +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
Nicolas Martinelli 08dc1fc268 [FIX] sale_coupon: fix test
Following https://github.com/odoo/odoo/commit/87c09b8ebcea950b628e5c7adfe847b9f8b6c031
the default COA taxes are not used as sale/purchase default taxes.
2018-03-16 08:31:03 +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
Christophe Simonis 3e8443b5de [MERGE] forward port branch saas-11.2 up to cd34fda4ba3 2018-03-09 16:27:28 +01:00
Christophe Simonis f6e09b241f [MERGE] forward port branch 11.0 up to 6716614fb7b 2018-03-08 19:17:18 +01:00
Christophe Simonis abfa3a0ae2 [MERGE] forward port branch saas-15 up to 6d84aa578e8 2018-03-08 18:34:52 +01:00
Christophe Simonis 9d7aaf53a0 [MERGE] forward port branch saas-14 up to d37606c75b5 2018-03-08 18:34:28 +01:00
Hugo Adan 48a38e15ce [FIX] sale_coupon: Moved data/demo wrongly declared as data/data
Before this commit, demo data were listed as normal data.

opw-1823343
Closes #1949
2018-03-08 14:17:35 +01:00
Nicolas Lempereur 7fc5738d36 [FIX] sale_coupon: typo applying a42c27f in s11.2 2018-03-05 23:38:25 +01:00
Christophe Simonis 34ee72f7c0 [MERGE] forward port branch 11.0 up to 10886317711 2018-03-02 17:55:33 +01:00
Christophe Simonis 11a089969f [FIX] sale_coupon: relative import 2018-03-01 18:50:12 +01:00
Christophe Simonis c5450ca0c0 [MERGE] forward port branch saas-15 up to 9aca5ca19d0 2018-03-01 18:18:16 +01:00
Christophe Simonis c4be2c6d28 [MERGE] forward port branch saas-14 up to 06572f39cdb 2018-03-01 17:40:01 +01:00
XavierDo 5bb0318ab4 [Imp] product: move uom in a new addon
Adapt enterprise branch to match changes applied in commit 1b64b193f9a6cfd26dee3d723eac968fa4c5000e
2018-02-26 15:14:36 +01:00
Romain Derie c69778fe6f [IMP] sale_coupon, website_sale_coupon: add tests
Commit a42c27f99e0061b7c4f recently fixed some bugs on sale_coupon.
This commit add some tests to be sure theses bugs are fixed and won't appear
again.

This closes #1744
2018-02-23 18:37:20 +01:00
Romain Derie ef5d056403 [FIX] sale_coupon: fix some use cases
Some use cases were wrong, this commit attempt to fix those.
Here is the most important ones:

1. Discount was offered on free product 'value' aswell

Cart: 4 iPad Mini + one free offered + 10% discount

                      |    qty | unit value |   line total |
	----------------------------------------------------
	iPad Mini     |      4 |        320 |         1280 |
	- 10% discount|      1 |        128 |          128 |
	= 1152
	- free product|      1 |        320 |          320 |
	= 832

Should be

	              |    qty | unit value |   line total |
	----------------------------------------------------
	iPad Mini     |      4 |        320 |         1280 |
	- free product|      1 |        320 |          320 |
	= 960
	- 10% discount|      1 |         96 |           96 |
	= 864

The error result is $32 which is the 10% discount applied on the free iPad.

2. Decreasing product quantity below the minimum threshold to be elligible for
the promotion doesn't remove the product

  - (With a promotion offering a free iPad when you buy 3 (fourth is free))
  - Create a quotation with 3 iPads Mini, save and update promotions, you don't
    have a free one, which is 'correct'
  - Edit, change the quantity to 4 iPads, save, update promotions, you have a
    free iPad (reduced from total), still correct
  - Edit, change the quantity back to 3 ipad, update ptomotions, you still have
    a free iPad even if you only bought 3 of them (the way it is designed, the
    free iPad should only appears when you order your fourth).

The error result in a 'loss' of $320 since at the end we are offering a free
iPad and the user only pays 2 instead of 3.

3. Free product will be considered as regular product when updating quantity
of regular product afterward

This error is kind of exponential: the more you play with the flow explained
bellow, the more incorrect it becomes.

Buy 100 iPads, get 25 free iPads.
Then set quantity (on regular iPad) to 50, it will recalculate the amount of
free iPad thinking the 25 previous free iPads are regular iPad.
(50 + 25) = 75 regular iPads = 18 free iPads (25 previous free iPads were
wrongly used for the calculation but they are simply gone at this point).
Cart is now 50 regular iPads and 18 free one, total: $10240 (50×320 - 18×320).
It should be 12 free iPads, not 18, so $12160 (50×320 − 12×320)

The error result in a loss of $1920: ~ 20% of the total amount of the order.

This error will also appear the other way around if you add quantity instead of
removing some.
Playing with this error multiple times, you can arrive to a negative total
(more free than paid products), 0 total or very low total ($320 for 100 iPads).

4. Free product are wrongly calculated, user get too many of them

  - Create a quotation with 10 iPads, you get 3 free iPads instead of 2
  - Indeed, your first 4 iPads should give you a free one
  - Your next 4 iPads should give you a second one (you got 8)
  - The last 2 (to reach 10) are not enough to give you a third free iPad

The error result in a loss of $320 out of a total of 2560$ which is ~ 15%

5. Paid/regular products related to a promotion won't be taken into account
 when checking if you have the minimum amount threshold to apply the promotion

Promotion: 3 Computer Case(25$) = 1 Free Little Server (40.000$), auto applied
  -Have a cart with 3 'Computer Case' and 2 'Little Server'
  -One little server of the 2 is free (because you have 3 computer cases)
  -You so pay 3x25 + 1x40000 which is 40075$
  -Create a promo code that will give you 10% discount if you bought over $2000
  -You won't get the reduction even if you bought over $40.000 because the
   little server you pay is considered as the product of the reward product
   even if you dont have it free. It doesn't check how many regular product
   should be substracted according to the number of free product you have

6. Wrong product is checked for the required quantity to apply the promotion

Promotion: 3 iPads Mini ($320) = 1 free Bose Mini Bluetooth Speaker ($247)

  - Add 8 iPads Mini and a Bose Mini Bluetooth Speaker to your cart
  - The system should give you a free Bose Mini Bluetooth Speaker since you
    only have one regular Bose
  - But the system is giving you 2 free Bose Mini Bluetooth Speaker

Cart is: 8 iPad ($2560), 1 Bose ($247), 2 free Bose (-$496)
The system think that it should give you 2 free Bose because you are eligible
to, since you have 8 iPad, but it doesn't check that you have enough regular
Bose.

The error result in a loss of $247 out of a total of $2311

7. Auto applying promotion are not applied if there is already a promotion code
Promotion:
  - Free iPad Mini if you buy 3 (so the fourth become free), auto applied
  - 10% discount with code '10pc'

  - Add 4 iPads Mini, you got a free one
  - Set quantity back to 1 iPad, free one is gone
  - Add code 10pc, you got a 10% reduction line
  - Set quantity to 4 iPads again, you dont have the free iPad since there is
    already a promo code

This could make sense but it is not coherent since the 2 promotions would be
applied if they were both on auto apply mode.
Note:
  - If both promotions are on auto apply, you will get both
  - If 10% discount becomes auto applied and iPad promotion now has a code
    (reverse situation) it will work

8. Discount is only applied on untaxed amount, not on tax

Discount will ONLY be calculated on the untaxed amount and then reduced from
the sale order/cart total.
The taxes would be unchanged and charged like the product was full price.

Let's illustrate with a $100 product, a 15% tax and a 20% discount:

1. Tax included:
$100   : Product with 15% included taxes
$86.96 : Untaxed product
$13.04 : Taxes

After aplying 20% discount, result should be:
$80    : Product with 15% included taxes
$69.57 : Untaxed product
$10.43 : Taxes

Instead we have:
$82.61 : Product with 15% included taxes
$69.57 : Untaxed product
$13.04 : Taxes

There is a difference of $2.61 which is the result of the taxes not being
discounted: 13.04-10.43 = 2.61

2. Tax excluded:
$115 : Product with 15% excluded taxes
$100 : Untaxed product
$15  : Taxes

After aplying 20% discount, result should be:
$92  : Product with 15% included taxes
$80  : Untaxed product
$12  : Taxes

Instead we have:
$95  : Product with 15% included taxes
$80  : Untaxed product
$15  : Taxes

There is a difference of $3 which is the result of the taxes not being
discounted: 15-12 = 3

9. Taxes of the free shipping reward would be considered as paid value when
checking if required threshold is met.

------------------------------------------

Not really a bug, more an improvement:

1. The way it was designed, the rule_minimum_amount would check if your order
amount was over the required threshold to be eligible for the reward.
'Problem' is that it your order has already a discount (eg: 10%), it would
check if the price without discount is above the required amount.
I don't think it is coherent, let's illustrate:
  - First pomotion (auto applied): 1 iPad Mini for free if you buy over $2000
  - Second promotion (auto applied): 50% on order

If an user is buying for $2000, he is actually paying $1000 thanks to the 50%
discount.
Should we give him the free iPad?
The current implementation is giving it, which is not convenient IMHO.
Now, we use the amount the user really pay to check if he is elligible.

2. Since new promotions have the same sequence by default, they will be sorted
and applied by their creation order. This will result in inconsistent behavior:
  - Promotion 1 : 10% discount
  - Promotion 2 : free shipping
  - Both promotion are auto applied and need a minimum of $872.73 tax excluded

Let's illustrate with a $873 order:
If the promotions were created in the order above, you won't get both rewards
since the 10% discount will be applied first and will lower the SO total.
The order will then fall below the $872.73 required amount and won't be
eligible for the free shipping.
But if you created the free shipping promotion before the discount one, you
will be eligible for both since the free shipping will be applied first and
won't change the SO total.

To keep the same behavior independently of the promotion creation order, we now
sort by reward_type ('discount' > 'free_shipping' > 'product' to apply
discounts first.
This is better IMHO, since you want to give promotions with a minimum threshold
ONLY if the user really pays that amount. It wouldn't be the case if the total
is checked before the discount is applied.
2018-02-23 18:36:19 +01:00
qdp-odoo 722d9343b8 [FIX] *: fixed decorators on copy() 2018-02-09 10:32:39 +01:00
Christophe Simonis 5c81da0088 [MERGE] forward port branch saas-11.1 up to 6e2211545a1 2018-02-01 18:21:17 +01:00
Christophe Simonis 1888989d53 [MERGE] forward port branch 11.0 up to 1058976369e 2018-02-01 18:15:34 +01:00
Christophe Monniez 5e1aa6a224 [FIX] sale_coupon: add missing dependencies on computed fields
Thanks to @rco-odoo
2018-02-01 13:56:29 +01:00
Goffin Simon c96e865551 [FIX] sale_coupon: consumed coupon gets no reference to order
The field sales_order_id was not displayed in the sale.coupon form view
to get the information about 'Applied on order'.

opw:806508
2018-02-01 11:15:24 +01:00
Martin Trigaux 6e71f3acdf [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

Fixes odoo/odoo#22333
Closes #1823
2018-01-31 13:43:44 +01:00
Alexandre Kühn 8dc38eb48a [IMP] core: menu tip ux/ui improvement
We would like to make the "no item found" screens more appealing.

Before this commit, it shows a small help tip in the top-left
corner of the screen, just below the "Create" button.

With this commit, these help tips have been replaced by onboarding
screens, which consist of a picture and some text below, both of which
are horizontally centered.

The texts have been slightly changed, so that they are shorter and clearer.

Considered modules:

(A)
    account_batch_deposit,
    account_deferred_revenue,
    account_online_sync,
    account_reports,
    account_sepa_direct_debit
(H)
    helpdesk,
    hr_appraisal,
    hr_contract_salary
(L)
    l10n_mx_edi
(M)
    marketing_automation,
    mrp_plm,
    mrp_workorder
(P)
    pos_loyalty
(Q)
    quality,
    quality_control,
    quality_mrp
(S)
    sale_coupon,
    sale_subscription
(V)
    voip
(W)
    web_enterprise,
    web_grid,
    web_studio,
    website_calendar,
    website_crm_score,
    website_sign
2018-01-18 21:44:00 +01:00
Martin Trigaux 7819a498bb [FIX] sale_coupon: missing parenthesis 2018-01-16 11:05:54 +01:00
Christophe Simonis 8570c32d42 [MERGE] forward port branch saas-11.1 up to 16ddd0216ee 2018-01-12 19:13:14 +01:00
Christophe Simonis 4227c0b3d0 [MERGE] forward port branch 11.0 up to 335a163fa5b 2018-01-12 19:06:53 +01:00
Christophe Simonis a1090e0c20 [MERGE] forward port branch saas-16 up to 8a03952243d 2018-01-12 18:23:30 +01:00
Christophe Simonis cebe2d795e [MERGE] forward port branch saas-15 up to 83170802a26 2018-01-12 17:31:48 +01:00
Christophe Simonis 456ff2b565 [MERGE] forward port branch saas-14 up to 9d019bb5119 2018-01-12 16:47:29 +01:00
Romain Derie 4c6b474505 [FIX] sale_coupon: min quantity set to 0 will crash backend and shop
Before this commit, if minimum product quantity was set to 0 on a coupon
program, it would then throw:
  - On backend, when updating promotions
  - On frontend (shop), user won't access his cart (error 500)

Now, we prevent quantity from being lower than 1

Step to reproduce:
  - Create a coupon automatically applied, set quantity to 0, set reward to
    'Free Product' and set free product to iPad Mini
  - Go to /shop and add a iPad Mini to your cart, it will throw an error 500
    instead of redirecting to your cart
  - Go to backend, click on 'Update Promotions' on a quotation, it will show an
    error popup
2018-01-12 12:37:48 +01:00
Kinjal Mehta 702f061f05 [IMP] sale_coupon,sale_ebay: changed duplicate field label in the same model 2018-01-04 17:27:25 +05:30
Christophe Simonis 39c9f0c972 [MERGE] forward port branch saas-11.1 up to 6cb9ed4c424 2018-01-03 14:23:59 +01:00