Commit Graph
22 Commits
Author SHA1 Message Date
Florian Damhaut 14f2086ea7 [FIX] delivery : removed service from rule-based delivery quantity
Current behaviour :
Product of type service are accounted for when computing the quantity, weight and volume metrics used in the price computation of rule based delivery.

Planned behaviour :
Service-typed product should be excluded from such computations.

opw-2647067

closes odoo/odoo#78402

X-original-commit: 2993c82db51e16787de72cbb67f04d5ae1928b68
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-15 11:31:49 +00:00
Víctor Martínez 045ed49d15 [IMP] delivery: Hook allowing to retrieve dict to be used in _get_price_from_picking() function.
Hook to be overridden when we need to add some field to product and use it in variable factor from price rules.

closes odoo/odoo#74561

X-original-commit: 6ec768d084da6bd7344c45750a2a5037ec366143
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-08-02 12:09:43 +00:00
Adrien Widart 4ad547aeca [FIX] delivery: shipping cost free if above amount
A based on rules shipping method with the "Free if order amount is above" field enabled is not correctly applied.

To reproduce the error:
(Need website_sale)
1. Go to Settings > Website
2. Enable "Shipping Costs"
3. Go to Website > Configuration > eCommerce > Shipping Methods
4. Create a new one
	- Select "Based on Rules"
	- Enable "Free if order amount is above"
	- Set the corresponding amount
	- In pricing, add a line
5. Save & Publish (Click on "Unpublished")
6. Go to website's shop
7. Add the product set in the shipping method to your cart
	- Select an amount sufficient to exceed the threshold amount set in step 4
8. Process Checkout

=> The shipping method is shown, but the associated amount is "No price rule matching this order[...]"

The shipping method price should be 0.

(This error also happens when creating a SO)

OPW-2383258

closes odoo/odoo#62290

X-original-commit: 393b7ad7b7dff1cbf830374c76ef0a681a71be6a
Signed-off-by: adwid <adwid@users.noreply.github.com>
2020-11-25 08:06:09 +00:00
Robin Heinz c6d5948c75 [FIX] Delivery: Endless decimal display on list price
When creating a new delivery method with a provider based on rules, if the base list_base_price was equal to x.8, that ended to a float with endless decimal. (eg: 2.8000000000003)
This fix modify the display to show a rounded value.

closes odoo/odoo#54177

Task-id: 2272472
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-22 12:47:37 +00:00
Julien Castiaux ab4000fb3c [REF] base: Remove deprecated exceptions and osv
TL;DR: remember `osv` and `except_orm` ? You can forget about them.

* Deprecated `except_orm` dropped.
* `UserError` elevated as super type of all user-related
  errors.
* Unused `DeferredException` dropped.
* Unused `QWebException` dropped (real one is in `qweb.py`).
* `MailDeliveryException` made a python exception.
* `name` legacy exception attribute made an alias of the python standard
  `args[0]` attribute and deprecated.
* `value` legacy exception attribute dropped.
* `exception_type` RPC error response key dropped.
* Deprecated `osv` module dropped.
* `--osv-memory-age-limit` cli option made an alias of
  `--transient-age-limit` and deprecated.

The `odoo.exceptions.Warning` have long been a deprecated alias to
`UserError`. It is going to be removed in a future version but first we
explicitly deprecate it with a warning.

The `odoo.exceptions.DeferredException` was a very old internal
exception, it has been removed without deprecation notice as it is never
raised.

The `odoo.exceptions.except_orm` has been a deprecated exception type
with deprecation warning for 5 years, it has been removed in favor of
UserError which becomes the super class of all user-related errors.

The `odoo.base.models.ir_mail_server.MailDeliveryException` was
inheriting `except_orm`. As it is not related to a user error but is
more of a problem an admin much take care of, the exception has been
made a Python error.

The `exception_type` JSON key in RPC error responses was holding an
hardcoded value derived from the exception type. Its usage has been
dropped in favor of the `name` JSON key that holds the precise exception
name. Again as it was hardly used in the source code (beside the crash
manager) it has been dropped without deprecation warning.

Since we are here trying to clean odoo custom exceptions, we are also
deprecating the `name` exception attribute in favor of the more standard
`args[0]` attribute.

The `name` (along with `value`) were two attributes used to raise
`except_orm` exceptions before the introduction of `UserError`,
`AccessError` and related exceptions. The `name` attribute, at the time,
was holding the exception type/title. Nowadays it contains the error
message. The `value` attribute, at the time, was holding the error
message. Nowadays it is no more used.

The `osv` module contains very old deprecated aliases. There is no
simple way to log a deprecation warning for osv, osv_memory and
osv_abstract but as they have not been in use for ages, they have been
removed too. To be consistent, the `--osv-memory-age-limit` cli option
has been made a deprecated alias to the `--transient-age-limit`.

closes odoo/odoo#45723

Task: 2187728
Related: odoo/enterprise#9162
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-08 08:41:17 +00:00
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
Pierre Masereel b10841acbe [FIX] delivery: access rights when computing price rules
When a picking is validated with the delivery prices based on rules, you
can face an error, if you are not inventory manager or sales manager.

First, because you don't have access rights to see the sales orders used
to compute the price.

And then you don't don't have access rights on the delivery.price.rule
object to apply the formulas.

As the computation of the price of a delivery should not depends on
access rights other than the ones that let the user validate the
picking, as 'sudo' is called.

OPW-2209148

closes odoo/odoo#46947

X-original-commit: b68139bf2fec8fd2a79e1a578d126f260891c4f6
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-03-05 09:57:32 +00:00
Mitali Patel 9d710df076 [REF] *: use the new decimal precision syntax
Since previous commit moved decimal_precision module's feature into base,
use the new syntax for fields declaration
Remove the imports to the removed module
Remove the module from dependency in manifest

sed -i "s|digits=dp.get_precision('\([A-Z a-z]*\)')|digits='\1'|" **.py
sed -i "/from odoo.tools import decimal_precision as dp/d" **py
2019-07-03 11:16:24 +00:00
Christophe Simonis 49c3264ce0 [MERGE] forward port branch saas-11.3 up to 4850fb0838 2018-09-07 14:43:48 +02:00
Goffin Simon d448849ba3 [FIX] delivery: Error message for unavailable delivery methods
With a fixed price delivery method, the error message was not displayed when
the address doesn't match.

Inspired from function base_on_rule_rate_shipment

The error message was not clear enough.

opw:1879204
2018-09-03 11:13:34 +02:00
Benjamin Stiens 6383120f3b [IMP] all: Improve error messages
Many error messages are misleading or too "vague"
This task aims to improve all error message.

Task #47042
PR #23321
2018-05-28 16:45:48 +02:00
Yannick Tivisse 7a282c9965 [IMP] *: Replace all occurences of 'compute' by '_convert' 2018-04-13 16:54:28 +02:00
Christophe Simonis fcfb4782b6 [MERGE] forward port branch saas-17 up to a445548f07 2017-08-02 12:31:05 +02:00
Richard Mathot e449291f28 [FIX] delivery: don't crash ecommerce when no grid has been found
(+ improve a bit the error message)
2017-08-01 09:35:46 +02:00
Richard Mathot b8f574a464 [FIX] delivery: wording 2017-08-01 09:35:46 +02:00
Richard Mathot 45ca8f41d6 [REF] delivery: remove inherits with product.product
(Actually, a good old m2o is enough.)

We also clean a bit the delivery.carrier view.
2017-07-20 15:32:21 +02:00
Christophe Simonis 9185eb4b79 [MERGE] forward port branch saas-17 up to f830f14d98 2017-07-20 13:26:09 +02:00
Dhawal Limbuwala ee9b3e0d0c [IMP] delivery: notification email for shippings
When an order is shipped, a notification email is sent to the customer.
If there is a tracking URL, it is included in the email.

(and also a bit of refactoring)
2017-07-19 15:02:16 +02:00
Richard Mathot e297a7d541 [FIX] delivery: wrong variable returned 2017-07-19 12:27:50 +02:00
Richard Mathot 861343821d [FIX] delivery: typo in method names 2017-07-18 17:14:04 +02:00
Richard Mathot 760cffe8e6 [FIX] delivery: sale_id may not be set for a picking 2017-07-18 11:18:18 +02:00
Richard Mathot f963500a9f [IMP] delivery,website_sale_delivery: refactoring and cleaning 2017-07-13 12:32:22 +02:00