In saas-15.1 move_lines on `stock.picking` has been rename in
move_ids.
It was miss during #81595 and it's fixed now
closesodoo/odoo#82397
X-original-commit: fd531c7b0baa742cefb7a09c557617806d8a563a
Signed-off-by: Arnold Moyaux <arm@odoo.com>
When having a shipper for a DO, if the user creates a backorder, the
information won't be sent to him.
To reproduce the issue:
(Use demo data)
1. Create a sale order SO with 2 products
2. Add Shipping: UPS US
3. Confirm SO
4. In the associated picking, deliver one of the products and create a
backorder
5. Process the backorder
Error: In the chatter, there is a label for the first picking but there
isn't any label for the backorder
When confirming the sale order, the backorder is first created and then
the initial picking is sent to UPS. As a result, considering the current
body of `send_to_shipper`, the field `carrier_tracking_ref` of both the
initial picking and the backorder is defined with the same value (i.e.,
the tracking number of the initial picking)
Therefore, when processing the backorder:
https://github.com/odoo/odoo/blob/f29da79ef64a8166e54544d1787912be5665076a/addons/delivery/models/stock_picking.py#L126-L129
`carrier_tracking_ref` is already defined, so `send_to_shipper` won't be
called
OPW-2678549
closesodoo/odoo#81599
X-original-commit: 89f9281b096e24583ff7780a1bb42f0c4b7b477e
Related: odoo/enterprise#22980
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Added a hook in delivery to check if an Amazon order's delivery is Amazon compliant.
task-2573260
closesodoo/odoo#73494
X-original-commit: eb23d10b22c0cafc935d01effc680aebdbdf0057
Related: odoo/enterprise#19578
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Currently, delivery packaging and product packaging share the same
model product.packaging. In this commit, we make delivery packaging
a new model stock.package.type. The code is also moved to stock
instead of delivery for compatibility reasons.
Task 2341820
PR #63516
ENT PR odoo/enterprise#15363
UPG PR odoo/upgrade#2040
In this commit -
1) Added new field propagate_carrier_id in stock.rule and propgate
carrier in PICK PACK and SHIP if it is ticked.
2) Allow to print Label at any stage of PICK PACK and SHIP after
validation of picking from chatter.
Task-2363484
closesodoo/odoo#62851
Related: odoo/enterprise#15148
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Issue
- Ensure that the provider of "The Poste" delivery method is "Based on Rules".
- Create a quotation with "The Poste" as shipping method.
- Confirm, then click on "Delivery" stat button.
- Click on "Put in Pack" and create a "Delivery Packaging".
- Save, go back to quotation and duplicate it.
- Confirm, then click on "Delivery" stat button.
- Click on "Put in Pack".
The "Delivery Packaging" created previously is not available.
Solution
If 'current_package_carrier_type' is equal to 'fixed' or 'base_on_rule',
replace it by 'none' since there are the equivalents in
'package_carrier_type' for 'delivery_type'.
Related fix : https://github.com/odoo/odoo/pull/37427
opw-2310258
closesodoo/odoo#57444
X-original-commit: 5898d31025eacad3e8c37f7a105e20c81831ed17
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.
Add sudo for other operations on ir.actions.*
This commit makes it so if a delivery slip contains 1 or more packages
then move lines will be split by package (and non-package) groups with a
"section line" between them. This only applies to when a stock.picking
is 'State=Done'.
In order to accomodate complexity of splitting by package + grouping by
product unless printing serial numbers/lots + template inheritance,
reoccurring parts of the template are split into their own templates and
called. Relevant inheritance has been updated to match.
Additionally, picking.shipping_weight calculation has been updated so if
a pack.weight = 0 then calculation will default to the calculated
product weight. This prevents inconsistency between the "Total Weight"
at the top of the Delivery Slip and the package sections' displayed
weights. To distinguish which value is being used, package sections that
use the total product weight rather than the pack.weight have
"(estimated)" after it.
This completes subsection 3 of overall Improve delivery slip task.
Task: 2039720
When more than one parameter is present in a message, it helps the
translation to use named placeholder. This way, the order can be
changed. It also helps the comprehension of the message.
In case `carrier_tracking_url` is `False`, a `TypeError` is raised and
not catched.
opw-2232268
closesodoo/odoo#49083
X-original-commit: a4b5bd7770bca3f2e4327c65de673e2fcc00e7e5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, on a picking, when we want to put in pack, we can't
select packages created with no package carrier type as they had a
confusion between `package_carrier_type` and `delivery_type` when we
pass the value in the context (value who is reused to the package
domain, making some package unfindable).
closesodoo/odoo#46992
X-original-commit: 21f054731e8635b9e3681e673a7cbf627ad49cca
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
- The volume field of stock.picking extended in delivery was unused,
-> remove it.
- The commit 2ff3749064, add
the 'check_packages_are_identical', which is never used.
- Remove useless variable 'res' of print_return_label in stock_picking
task-2201168
closesodoo/odoo#46516
Related: odoo/upgrade#866
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Steps to reproduce:
- install sales and easypost shipping
- have a delivery order of multiple packages with easypost
- click "send confirmation email"
previous behavior:
the template does not handle multiple package references
and the associated link is wrong
current behavior:
each reference is set in a separated link
opw-2167037
closesodoo/odoo#45507
X-original-commit: 65eaa3e7daf0b547ae2bb98e335fc5941cb200a6
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
If the shipping weight is changed on a package, we want to update the
shipping weight on the picking to be consistent.
We also want to be able to set a shipping weight on a package that has
no carrier packaging, as we'll use the default one set on the carrier.
Use the 'Volume' decimal precision on all `volume` fields.
Complement of commit c1a5221ba2
opw-2185374
closesodoo/odoo#44473
X-original-commit: dc0111d6cdf4032fa840f9ff95f4fa687d33f77c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Let's consider a delivery method DM with fixed price of 10€ and a margin of 20%
- Let's consider a storable product P
- Create a SO for P and get the rate (12€) but don't add it on the SO
- Confirm the SO and process the delivery
Bug:
A SO line was created for the freight cost without the margin. So it was 10€
instead of 12€.
opw:2144894
closesodoo/odoo#43279
X-original-commit: 621dac802ddddc3a4dd58f7370250386e1031598
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Since new ORM in Odoo, the compute methods should always return values.
In the case of return label in delivery, nothing was returned when there
was no carrier on picking.
So we are now setting the field to False when there are no carrier on
picking.
ISSUE-43270
closesodoo/odoo#43452
X-original-commit: 9bf52959a5afad01970f1ef39a64d6b3694abcc8
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
When real cost invoice policy is active in a delivery carrier, the
delivery price is set after validating the delivery. When there is
margin, the estimated price is calculated with margin but when the
delivery is validated, the price set in the delivery line does not
include the margin. This commit fixes this behavior by setting the price
of the delivery line with appropriate margin.
closesodoo/odoo#37178
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Be in multi-company, with shared products, let P be a product in company C.
Suppose there are stock moves or pickings in company C'.
Suppose a non-admin writes on P: it triggers an access error.
Stock moves are not shared across companies in all cases.
So fields that depend on product_id might trigger a recompute on stock.moves
that are in another company, and thus trigger a spurious ACL error while
simply writing product attributes.
Note that _cal_move_weight depends on product_qty, however it is not sufficient
to only put that field in compute_sudo; the product_qty has already been marked
as todo, and so it is recomputed in the initial environment.
opw 2066691
forward port of 7d4d8fa18aecb3b78c8d359434a165c1de71a9b4
closesodoo/odoo#36838
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
The carrier argument passed to the _create_delivery_line function
can be different to the carrier already existing in the sale order
so we should use the correct setting of carrier where we are calling
the function.
closesodoo/odoo#36424
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
The user can already send a confirmation email when the
Stock Picking is done. It'd be great to communicate the
same information by SMS.
In addition, the current mailing tool requires a manual
action. The idea is to automate the process via a
Setting instead.
id=1972567
closesodoo/odoo#35662
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.
Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
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
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.
Task 1937686
closesodoo/odoo#31243
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The depends value on picking weight and package_ids of picking are only
set on the move_line_ids, which lead to compute the value of the picking
weight only when move lines are created or deleted and not when a
package is set on a line, quantity done changed and/or unit of measure
changed.
To fix this issue, we've changed the depends, of thos computed fields.
closesodoo/odoo#33114
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Purpose
=======
Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.
It is confusing for users to see the records from the company he is connected to
and the records of the children companies.
Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.
/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.
Specifications
==============
1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.
2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.
3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.
4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.
5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.
6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.
7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids
8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.
9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.
10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.
11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624
12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.
13/ Introduce a res.group to enable/disable the multi company per tab
feature.
14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.
15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.
16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.
17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.
TaskID: 1960971
closesodoo/odoo#32341
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is not needed (and not wanted) in saas~12.1 due to
07bef887af that convert field
`move_ids_without_package` to a computed field with an invert method.
The invert method writes on `move_lines`, which will recompute the value
of `weight` field correctly.
This reverts commit b2b395467f.
The delivery lines (move_lines) have two way to be displayed in a view:
- with move_lines (all move line of a stock.picking)
- with move_ids_without_package (same but removing packages)
But so if we write directly on move_ids_without_package we would not
trigger the stock.picking @api.depends('move_lines') _cal_weight method
thus the picking weight was not updated in some instances.
With this changeset, we adds the move_ids_without_package as depends so
on move_ids_without_package onchange the total weight should be set to
the correct weight or 0 (if move_lines is not in the view) and on write
the correct weight should be computed.
opw-1959523
closes#32157
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Until now, only fedex was providing return label printing, and as we
want to integrate it with other carriers, we have mande a generc
mecanism to easily implement it with new ones.
We've also added an option that allow to print return label from portal
if one has been generated on delivery.
The package creation was done even before the call of the 'choose.delivery.package' wizard, so the 'Discard' button of the wizard was useless.
This commit fix this behaviour by creating the package only when the "put_in_pack" action is called from the wizard.
The default weight is thus no more based on the default package but on the picking related to the package.
The method 'manage_package', 'default_stock_quant_package_id', 'self._default_delivery_packaging_id' were removed since they are no more relevant.
The method 'check_destinations' was refactored to '_pre_put_in_pack_hook' to avoid confusion related to its misleading name
TaskID: 1924875
closesodoo/odoo#30324
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
The delivery carriers get a new field to specify the invoicing
policy. The two cases are :
- Estimated cost: the delivery price is charged directly on
the sale order based on the estimated fee
- Real cost: the delivery price is estimated from the sale order
but not added in the delivery line (we get a line with quantity=1 and price = 0).
Once the delivery is validated, the delivery price is recomputed.
The new price depends on the integration level. If it's 'rate', the price is
the estimated one (carrier.rate_shipment()). If it's 'rate_and_ship, the price
is the one given by the carrier at the delivery
The bases carriers (fixed_on_rule and base) always use 'Estimated Cost'
as their price should not be changed between the sale order creation
and delivery validation
Task : 1908654