Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16.0 mig sale by packaging #2622

Closed

Conversation

nilshamerlinck
Copy link
Contributor

No description provided.

grindtildeath and others added 30 commits June 16, 2023 15:58
The functions of this module were first added into sale_order_line_packaging_qty.

After sorting out and extracting the different functions in multiple modules in
the previous commits, this one gets it all together in a single module.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Following warning is shown at runtime:

WARNING odoodb_test odoo.models: method product.template._check_sell_only_by_packaging_can_be_sold_packaging_ids: @constrains parameter 'packaging_ids.can_be_sold' is not a field name

Only fields of the current model can be used in a constrains.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
…g SO line create/update

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
The automatic assignation of a packaging and packaging quantity was done
only for product to `only_sell_by_packaging`
But if possible it should also be done for other products.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
When a product must be sold by packaging do not allow for a packaging
qantity at zero or negative.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
When the uom quantity of a sale order line is changed for a value that
is not a multiple of possible packaging. The packaging and the packaging
quantity must be reset to an empty value

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
This is taken from
OCA@290aed9

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
When a quantity is set on the sale order line before or at the same time
than the product itself, the onchange triggered will replace the line
set quantity with the default size of the package.
This is especially problematic for sales order created programmatically.
So to improve the solution, if the quantity fits with the package
quantity it is kept.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
The test was calling the onchanges manually to test their result, but as
some onchanges must be called in cascade to have a correct result, the
test tells more about itself, if it calls the onchanges in the correct
order or not.
Using Form will test them correctly in cascade automatically.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
This feature was problematic because for order created programatically
By changing the packaging on product change the quantity ordered would
also change.
The correct packaging will be set on save.
And if not possible an error will be raised by a constraint.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Before this change the packaging was always overridden
hence the user had not control on the packaging to be used on SO line.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
When the product_uom_qty is computed from inverse method of packaging qty
the packaging is already there and there's no need to auto-assign.

This also prevents skipping direct writes on prod uom qty or other keys
other than product_packaging.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
This check is already done by core sale module.
Tests where not checkingt for that specific exception.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
This change allows to be more specific on which product.packaging can be
sold or not.
By default the value from the product.packaging.type is used. But it is
editable afterwards, with this change.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
The product_product_packaging_qty on sale.order.line should always be an
integer, no ?

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
kevinkhao and others added 18 commits June 16, 2023 16:07
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
The dependency product_packaging_type was renamed to
product_packaging_level.

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.