Previous to this commit, only the return labels had a consistent prefix
for their filenames. This meant that all other shipping related
documents had their filenames manually + inconsistently created as
strings in every shipping connector. This lead to difficult to
distinguish documents across different records' chatters.
This commit adds a consistent method for the shipping connectors to use.
Part of task: 3046178 - harmonize shipping label names
ENT PR: odoo/enterprise#43362
Part-of: odoo/odoo#126791
Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).
Also
- removes translation markers entirely when there's nothing to
translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
(DRY is generally a bad idea when translations are involved, even
more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
to fill-paragraph): `\` escapes only the newline, if the
continuation string is indented this results in a bunch of spaces
ending in the string to translate, which is pretty garbage for the
translator, using implicit concatenation works much better
Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.
Not in scope:
Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders
- Provides more context / data to the translator to make sense of the
sentence.
- Allows reordering the translated terms, which can be necessary
depending on the sentence and language.
closesodoo/odoo#139314
Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The 'like'/'ilike' operators automatically add the wildcard character
(`%`) at the beginning and at the end of the value. This commit fixes
the incorrect usage.
closesodoo/odoo#136007
Related: odoo/enterprise#47886
Signed-off-by: Raphael Collet <rco@odoo.com>
When there are multiple tracking numbers in one picking, the tracking button
will work correctly.
Improve style issue for wizard form
closesodoo/odoo#134591
X-original-commit: c71dae98aff0c86aed88b7da79f99d91562c98cc
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
Bug:
bug introduced by previous fix
https://github.com/odoo/odoo/pull/130252
tracking number is set twice on the delivery
Fix:
only set the tracking number on the related picking where it hasn't been
set yet.
closesodoo/odoo#133004
X-original-commit: 09842a47c08a4cd9da3f5f4da1d7870d9ced9d02
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
Steps to reproduce:
- Install DHL carrier
- Enable multistep routes
- On warehouse config set 3 steps(pick,pack,ship) on outgoing shippments
- Create an SO and add DHL shipping
- Validate the first picking and send to shipper
Bug:
only the first picking has a tracking ref
this causes an issue because this an in internal picking and only the
last is shown to the customer on sales portal so the customer doesn't
have acces to the tracking ref
Fix:
set the referrence on all the pickings of the so
opw-3269257
closesodoo/odoo#132142
X-original-commit: fd19ba5483dc4312e4459100582f417a38b52b3b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
In this commit, we added a new field in the shipping methods this field can be
used select rules. These rules can only be used when the corresponding SO has
one of the selected shipping methods.
task-3236149
closesodoo/odoo#119320
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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
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
closesodoo/odoo#125573
X-original-commit: 79dad0a7599584f14e4ab3e96c393983e95aa519
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
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.
closesodoo/odoo#123993
X-original-commit: d5b64650d043f94f8e244c993eff36ed26a93a32
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
Steps to reproduce:
configure easypost for international shipping (e.g. using USPS)
Make a sale order for a customer in another country
Add a discount program (e.g. 10% off)
Attempt to add shipping and get the rates
Get traceback:
`Easypost returned an error: Wrong parameter type.
- value: must be greater than or equal to 0`
To fix this we need to exclude service type products when creating
commodities from order lines (similar to creating commodities from
stock move lines)
opw-3269467
closesodoo/odoo#122869
X-original-commit: c4904454d46036374ea5e9ae7047f1546e9cab44
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
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
closesodoo/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>
When using message_post, the body format must be explicitly specified.
If html is expected, a Markup object should be used.
If text is given, the content will be escaped.
Before this PR:
message_post was unaware if the content of a message was HTML or
text. This lead to multiple situation where the content was
incorrectly considered as HTML and led to display errors.
In
self.message_post(body="Hello %s!" % self.name)
if the name contained HTML, it would be evaluated.
In
self.message_post(body="Contact Raoul <raoul@caramail.be>")
the email would not be displayed as considered as unknown HTML and
discarded by the sanitizer
Now each call must explict the type of content.
Use the escape() helper to properly combine Markup and translations.
It would also be acceptable to use Markup() to wrap a static
translation but escape is better as one can not guarantee the content
of a translation.
closesodoo/odoo#111850
Related: odoo/documentation#3612
Related: odoo/enterprise#36728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
Make a sale order with a product and quantity > 1, add
FedEx international shipping and validate the delivery
In the document you will see that the unit cost is equal
to subtotal which is wrong.
There is a discrepancy between `_get_commodities_from_order` and
`_get_commodities_from_stock_move_lines`, that the former makes
commodities with `monetary_value` equal to the unit price, while
the latter uses subtotal. in the method `commodities` in
`delivery_fedex`, `monetary_value` is treated as unit price, so
the right way to fix it is to do it in
`_get_commodities_from_stock_move_lines`.
Note that when rating a delivery, commodities are made in
`_get_commodities_from_order` and then passed to `commodities`,
while for sending the shipping, commodities are made in
`_get_commodities_from_stock_move_lines`.
opw-3233369
closesodoo/odoo#117521
X-original-commit: 3beddbdd18937e1c69ec4fa6f523296c7c55528b
Related: odoo/enterprise#39234
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
Before this commit, if you made a product to be tracked by unique
serial number and then make a sale order with hundreds of units
of the same product, each unit will make a separate line with qty = 1.
The issue is each serial makes a different `stock.move.line` and
`_get_commodities_from_stock_move_lines` groups by move lines, which
leads to the issue.
To solve the problem we need to group the move lines by product.
opw-3212809
closesodoo/odoo#116882
X-original-commit: 3c4a12bac1302c8e39dc2a1c617e6536c2d07d3d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
Fix a forgotten field after a renaming after a forward conflict:
[REF] *{stock,mrp}*: rename reserved fields
This commit rename product_uom_qty into reserved_uom_qty and product_qty
into reserved_qty on stock move line to stop mistake them with the stock
move quantities fields.
Task: 2648449
Part-of: #80434
opw-3225854
closesodoo/odoo#115501
X-original-commit: 022de9edabb9993bfab6dd4e45feed788b7e1c38
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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