Commit Graph
2308 Commits
Author SHA1 Message Date
Christophe Simonis 522c8cd783 [FIX] delivery: correct selection value
Oversight of view-pocalypse (odoo/odoo#104741) that wrongly changed it.

closes odoo/odoo#132408

Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2023-08-19 12:02:42 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Gorash 1e12f68a1d [REF] base,all: Update modifier syntax: prepare view migration
These changes are made as a result of simplifying attrs and 'states' in
views.

Before applying the migration script, it is necessary to fix some views.
These views are erroneous and either work by chance or are simply
untested. We have for example wrong domains, elements used by modifiers
but not present in the view, obsolete domain operators, inherit views
not targeting the right views, xpaths using attributes as target, the
use of %(...)s in views, false attribute value types in python.

Part-of: odoo/odoo#104741
2023-08-18 09:49:12 +02:00
Michael Tietz 2f6b44d7e0 [IMP] delivery: Make delivery line creation and selection hookable
closes odoo/odoo#131047

X-original-commit: 1242d6309b9b76c2bea5606facd81d6d20fa8b65
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-08-11 21:32:53 +02:00
Valentin Vallaeys (vava) b610f2502d [FIX] (stock_)delivery: move test for real invoice on back order
In this commit*, the forward-ported test was not moved with the fix on
stock.picking from delivery to stock_delivery, although the test relies
on real invoicing, which is defined in stock_delivery.

Fixes build error 22434

* e1e04f3a176e15fdce81ce3036093d3951401f52

closes odoo/odoo#130217

X-original-commit: 5518daae14aa91e3c2c6723c6059f337c6ee0914
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-08-01 13:51:47 +02:00
Damien Bouvy e0a2c85d6b [FIX] delivery: adapt to base sale report layout changes
X-original-commit: f7c691ee78e9bfe3f8e131b5ce033e889e8bf2fa
Part-of: odoo/odoo#129492
2023-07-25 00:54:54 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
Victor Feyens 17bece3e79 [REF] sale,*: remove locked (done) SO state
It's not a specific state, it should be considered separately,
as a boolean.

This allows to reduce code complexity (flows should not rely (much) on
the locked logic) and to have a clearer flow.

Task-3163931

Part-of: odoo/odoo#115871
2023-06-22 15:40:51 +02:00
Walid 56227b9049 [FIX] delivery: Backorder shipping cost with invoice policy in real
port of this fix
https://github.com/odoo/odoo/pull/70454

Steps to reproduce the bug:

- Let's consider a delivery carrier DC with invoice policy = 'real'
- Let's consider a consumable product P with a weight = 1kg and sales price = 10€
- Create a sale order SO with 2 P and add DC as shipping cost
- Process the shipment for 1 P and create a backorder
- Process the second shipment with the last P

Bug:

Two lines L1, L2 with DC were created on SO but only L1 as a price unit and a description.
L2 had a price unit = 0€ and no description.

opw-3219711

closes odoo/odoo#125573

X-original-commit: 79dad0a7599584f14e4ab3e96c393983e95aa519
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-06-19 16:40:04 +02:00
Valentin Vallaeys (vava) 129618ae41 [FIX] (stock_)delivery: no stock.picking in delivery
In this commit
https://github.com/odoo/odoo/pull/121354/commits/7d1092ba0e970170ce66e77e6ddc4cab0e09563d
the forward-port automatically moved the test to `stock_delivery` but
the code change remained in `delivery`. Since it handles `stock.picking`
on a `sale.order`, and that `delivery` does not depend on `stock`
anymore, it should move to `stock_delivery` as well.

closes odoo/odoo#123993

X-original-commit: d5b64650d043f94f8e244c993eff36ed26a93a32
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-06-06 20:27:41 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Eteil Djoumatchoua (etdj) 171aa0ec25 [FIX] delivery_carrier,sale_giftcard: get the right shipping price even with gift card
Step:
- Create a product with sale price 120 USD
- Create a giftcard with balance 40 uSD
- Create a free Shipping cost of 40 USD fixed price and freeing above 100 USD
- Go to website->shop, select the product and checkout the cart(the shipping is free because price exceeds 100)
- Add the gift card to payment

Issue:
The shipping price gets from free to 40

Cause:
When computing the cost of the shipping the fact of the presence of a giftcard is not considered.

Solution:
Create a method to returns the amount of giftcard from a sale order and add to total price to check if the shipping is free

opw-3107284

closes odoo/odoo#120174

X-original-commit: c57184fd1c3d2846df4f618dee0027364eb62596
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Djoumatchoua Eteil Junior (etdj) <etdj@odoo.com>
2023-05-16 13:36:59 +02:00
kir-odoo 88bcd855ae [FIX] delivery: shipping carrier is set after delivery generated
Before this commit
==================
when SO is confirmed and Delivery is created then add the shipping method
in SO, in this case, the shipping carrier is not set in the existing undelivered
delivery of that SO.

After this commit
=================
So in this commit, we set the shipping carrier for undelivered delivery.

taskId - 2946360

closes odoo/odoo#121363

X-original-commit: 51523c0dbf6ce9dd1a1ff35e03fa6a51267da14b
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-15 11:41:57 +02:00
Elisabeth Dickinson 45b9e04db4 [IMP] *: status buttons fix
Part-of: odoo/odoo#116641
2023-05-12 22:59:23 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Brieuc-brd 8a2875bb38 [IMP] delivery, sale_loyalty, project: adapt for milk
This commit adapts the spacing between the buttons in the
sale_order_views to fit with Milk.

project: layout fixes:
- Fixed kog displaying on top of the project status button
- Fixed the flickering in project updates when selecting rows in list
view

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:21 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Horacio Tellezandchevalierv 216fa84fbe [ADD] sale: add a products catalog view on the sale order
Currently, Fields Sales are struggling to create quotations or sale
orders directly from the customer place. One of the issues is that it
is not easy to quickly add products to the SO. Products must be added
one by one and, in mobile, it requires completing a form with
quantities, ... for each new line.  

This commit introduces a catalog view that allows users to select
products in a faster and easier way than before, both in desktop and
mobile view.

Task - 3062080

closes odoo/odoo#106382

Related: odoo/enterprise#37915
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: chevalierv <vcr@odoo.com>
2023-05-12 20:51:51 +02:00
prye-odoo c4dc4735c4 [FIX] delivery: prevent trace back while partner has no zip
In delivery address, `country name` and in shipping method, `country name`
will be same and no zip in delivery address.  While creating new sale order
along with product and clicking on "Add shipping",  error will be generated.

Steps to Reproduce
-Install `sale_management' and 'delivery' modules
-Go to the settings and enable the 'Customer Address'.
-Go to the settings and enable 'Shipping Methods' and configure it.
-Select a shipping method and  go to the 'Destination Availability' tab and
 set to the 'Countries' and set to 'Zip Prefixes'.
-Create a new customer and add the delivery address of the customer in
 res.partner.
-The delivery address and shipping method of the 'Countries" or 'Country'
 name should be the same.
-Set the  'Zip Prefixes'
-Set the delivery address of zip code null.
-Create a new quotation and add to the customer and delivery address
-Add to the product in the sale order line.
-Click on the 'Add Shipping' or 'Update Shipping Cost' button.

A trace back will be generated.

Applying this commit will resolve this issue.

sentry-4147077852

closes odoo/odoo#120968

X-original-commit: 60d5c7d5668da542e251d7d6fb8774043cfddea8
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-10 20:15:38 +02:00
althaf shaik 77f7cc2eb1 [FIX] delivery: price rule name not formatted if no delivery product
This trace back raises when we try to create delivery price rule,
while delivery product is not selected in the delivery carrier.

Steps to produce:
 * Install delivery,sales modules
 * Open Sales/Configuration/Shipping Methods
 * Create a new shipping method keep provider as 'Based on Rules'
 * Try to add a line for pricing
 * At this moment trace back raises ('Expected singleton: res.currency')

We resolve this issue by not formatting the name if the currency does
not exist yet, as the currency is related to the one of the product.

Sentry :- 4067992652

closes odoo/odoo#119958

X-original-commit: d20431758c0c4943394a63250ad0a83894b795c8
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-04-27 18:25:23 +02:00
Victor Feyens f4ea6d3226 [FIX] *: strict api for main orm methods
Enforce strict types for returned values for
* create
* write
* unlink
* default_get

to make those methods more consistent and reliable.
Also make sure they can be called with empty self/values,
i.e. that they follow the same behavior as the base methods
defined in the main orm Model.

closes odoo/odoo#116809

Related: odoo/enterprise#38880
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-04-25 15:20:43 +02:00
kir-odoo 71a2c5a551 [FIX] delivery: exclude neg qtys from shipping weight
This commit prevents inclusion of negative qty SO products from
the calculation of its estimated shipping weight. Negative qtys can
indicate a return, which would be a separate picking from the delivery
 => we shouldn't subtract their weight from the delivery. This
subtraction, may have resulted in shipping rates being calculated as
lower than they should have been within the SO.

Additionally fixes the following use case (requires Fedex connector):
- create a SO with 2 products with the same weight
- set 1st product qty = 1
- set 2nd product qty = -1
- add shipping => Shipping Method = Fedex US
- click on "Get Rate"

An error will occur because the SO._get_estimated_weight() = 0, and
you cannot have a rate for weight = 0

TaskId - 3028023

closes odoo/odoo#118348

X-original-commit: ecf0262e3ef746c33a29c4f2de7868e3ab61cce2
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-04-13 05:07:36 +02:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
Victor Feyens 6023c02380 [CLN] delivery: split delivery_view.xml (2)
Part-of: odoo/odoo#115811
2023-03-20 15:31:46 +01:00
Victor Feyens e9b6dae8e6 [CLN] delivery: split delivery_view.xml (1)
Part-of: odoo/odoo#115811
2023-03-20 15:31:46 +01:00
Victor Feyens f203b1e730 [CLN] delivery: clean files organization
Part-of: odoo/odoo#115811
2023-03-20 15:31:46 +01:00
Victor Feyens a80f32bbe5 [FIX] delivery: translate warning title
Part-of: odoo/odoo#115811
2023-03-20 15:31:46 +01:00
Valentin Vallaeys (vava) d3cddbe89a [FIX] delivery, website_sale: fix UX issues in views
In ecommerce, the form vue of shipping methods should be improved to
easily set up fixed delivery costs. This commit improves the
user-experience and solves bugs on the fields displayed.

task-3203210

Part-of: odoo/odoo#110686
2023-03-14 12:23:45 +01:00
Valentin Vallaeys (vava) a54c304487 [REF] (stock_)delivery: split delivery from stock
Extract the Inventory logic from the `delivery` module into a new
`stock_delivery` module. This will allow to integrate the basic delivery
features into the website_sale app in a one-app free database.

task-3074497

Part-of: odoo/odoo#110686
2023-03-14 12:23:44 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
Martin Maes 2b907e9f95 [IMP] deliver: add fixed margin
Removed the margin on rate when the provider is Fixed Price

Removed the margin on rate, free, amount when the provider is Based on Rules

Added a fixed margin for all the other providers

task-3043063

closes odoo/odoo#108794

Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-03-06 18:52:41 +01:00
Arnold Moyaux 52413adae6 [FIX] delivery,stock: missing hs code in delivery slip pre done
The delivery should provide the same feature before and after
validation of the picking (however lot/package need a validation)

So the HS code should be available direclty since it's a static value

closes odoo/odoo#113390

X-original-commit: 350015088d3822cde84b5dcf83d053350beafa66
Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-02-22 20:25:43 +01:00
LSE ef3bbc9293 [FIX] delivery: add commodities for packages from order
Before this commit:
1. Set up an EasyPost shipment setup, using
"Canada Post" as the Carrier Type and
"XpresspostUSA" as the Default Service Level.
2. Create a SO with a US customer (like Deco Addict)
3. "Add Shipping" using the button and choose the one created in 1.
4. When you try to "Get Rate" using the EasyPost shipment,
the API does always return the same error:
```
Easypost returned an error:
Unable to proceed, 'customs_info' is required for
international shipments, shipments bound for US
military bases, or US territories. Please see
https://www.easypost.com/docs/api#customs for more information.
```

After this commit:
As no commodities were set, `_customs_info` will return
an empty dictionary.
To solve that, we set the `DeliveryPackage` commodity
value on its initialisation to compute the customs
information the way it should.

opw-3104305

closes odoo/odoo#112988

X-original-commit: 06beca4373743787ae629b2c7ea623bf0583727a
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-02-21 15:53:11 +01:00
Touati Djamel (otd) f8cac8d384 [FIX] delivery: wrong delivery price for real cost in so
Steps to reproduce the bug:
- Install FedEx delivery
- Go to the shipping method > FedEx:
    - Select Real cost and margin on rate 10%
- Create a storable Product “P1” and update its qty
- Create a SO:
    - Add the product “P1”
    - Click on add shipping
    - Select FedEx and get the rate
    - Imagine the price is $10 and with margin it's $11

- Confirm the SO and process the delivery

Probelm:
The shipping price will be $12 instead of $11 in the SO

Because the estimated price is calculated the first time with margin
and added in the picking when sending to the shipper:
https://github.com/odoo/odoo/blob/afed7db30042e2ea91cdae292dadb7b6f742e33d/addons/delivery/models/stock_picking.py#L226

Then, the delivery cost is added to the SO, but the margin is applied a
second time:

https://github.com/odoo/odoo/blob/afed7db30042e2ea91cdae292dadb7b6f742e33d/addons/delivery/models/stock_picking.py#L246

https://github.com/odoo/odoo/blob/afed7db30042e2ea91cdae292dadb7b6f742e33d/addons/delivery/models/stock_picking.py#L262

so this commit is useless:
https://github.com/odoo/odoo/commit/632767d83e0f42acc5b486bde02dd1d9c2533911
because the `_add_delivery_cost_to_so` function is called only when
sending to the shipper

opw-3184482

closes odoo/odoo#113064

X-original-commit: b8c4fcbc1cba369dce8296b800565dfd181957a4
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-02-20 10:29:57 +01:00
Eteil Djoumatchoua (etdj) 67677a91a3 [FIX] delivery: add test for delivery w/carrier when no linked sale order flow
This commit adds a test to a fix done in https://github.com/odoo/odoo/commit/afed7db30042e2ea91cdae292dadb7b6f742e33d

bug introduced during: odoo/odoo#109298
opw-3162826

closes odoo/odoo#112451

X-original-commit: 7bbae5f8673c3ea8dfb428a1a7c1eb808f9139fc
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-02-13 09:17:19 +01:00
Stefan-Calin Crainiciuc (stcc) 383efd3d22 [I18N] delivery_grid: improved translation
Steps to reproduce:
- Install eCommerce, delivery
- Shpping methods > Create > Name = TEST, Product = Acoustic Bloc Screen,
Provider = Based on rules, Add a line > Condition = "Weight <= 0",
Delivery Cost = "50 + 0 * Weight" > Publish shipping method
- Go to the website > Add acoustic Bloc Screen to cart > Proceed to checkout

In the delivery section, the TEST shipping method will display the
warning message `No price rule matching this order; delivery cost
cannot be computed.` This message can be confusing to the customer.

opw-3110715

closes odoo/odoo#112002

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-08 14:30:50 +01:00
Pierre Masereel 44994bf419 [FIX] delivery: view references a field not in the parent
In the view 'view_order_form_with_carrier' we have an xpath to
'picking_policy' which is not in the parent view 'sale.view_order_form'.

The field 'picking policy' is set on the sale order view in the override
of sale_stock in view 'sale_stock.view_order_form_inherit_sale_stock'

So we've adapted the inherit_id to match the correct view.

closes odoo/odoo#111897

X-original-commit: 1e805aa773926f4ad8c9705cffdc433f5ca23621
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-02-03 21:49:41 +01:00
Valentin Vallaeys (vava) a7c0172727 [CLN] delivery: remove unused variables in tests
Part-of: odoo/odoo#111748
2023-02-03 11:45:43 +01:00
Valentin Vallaeys (vava) 45c210bb85 [FIX] delivery: add missing xml headers
Part-of: odoo/odoo#111748
2023-02-03 11:45:43 +01:00
Valentin Vallaeys (vava) f7c033eff7 [MOV] delivery: rename and split files by model names
Part-of: odoo/odoo#111748
2023-02-03 11:45:42 +01:00
Valentin Vallaeys (vava) ce35703ca3 [CLN] delivery: super(class, self) is not needed
Part-of: odoo/odoo#111748
2023-02-03 11:45:42 +01:00
Valentin Vallaeys (vava) 29060f3e06 [CLN] delivery: alphabetical order and guidelines for imports
Part-of: odoo/odoo#111748
2023-02-03 11:45:42 +01:00
Valentin Vallaeys (vava) c4d232668c [FIX] delivery: add missing odoo license header
Part-of: odoo/odoo#111748
2023-02-03 11:45:41 +01:00
Valentin Vallaeys (vava) fcfcc1b190 [CLN] delivery: remove utf-8 header in python scripts
Part-of: odoo/odoo#111748
2023-02-03 11:45:41 +01:00
Wolfgang Taferner ed8b0cb1dc [FIX] delivery: update_prices does ignore shipping rate
As sale does not know about special lines it will always update
the price based on product and price list instead of applying the correct
shipping rate, so we do skip those lines by using a newly introduced hook method

closes odoo/odoo#110782

X-original-commit: f1265b7fdce6bbe3fea97fc4b275dc2dca18103d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-01-24 10:20:38 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Demesmaeker 83c52575d0 [REF] product,repair,(*_)sale(_*): unrequired pricelist
Removes the constraint of using a pricelist and makes all sales flows
rely on the currency of the sale order (or repair order)

task-2735672

closes odoo/odoo#84920

Related: odoo/enterprise#24716
Related: odoo/upgrade#3642
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-01-18 21:08:52 +01:00