A PO must be in state cancel to be canceled.
Before the fix, it was possible to cancel a draft PO
then if a PO linked to a procurement was deleted with being
canceled, the procurement stayed in running state.
opw:666311
`default_location_dest_id_usage` on `purchase.order` is
used only for an attrs domain on the field
`dest_address_id` in the purchase order form.
There is therefore no worries to set it as readonly,
it won't break the feature he has been added for.
Besides, this will prevent the useless write of the
same field value on the related `stock.location`
when saving the purchase order.
This is important to prevent the useless write
on `stock.location`, as users might have the rights
to create/edit purchase orders without having
the write access to the stock locations.
opw-660736
Commit ec949ad5 links the extra move to the Sale Order through the
procurement. To be consistent, we also have to link the extra move to
the Purchase Order.
The original issue is that any extra move is not taken into account in
the received quantity calculated.
opw-665398
When a purchase order is created through a procurement order,
the purchase order pricelist is taken from
the partner `property_product_pricelist_purchase`,
which is a property, which therefore can be different
according to the company. This is therefore
important to force the company to the procurement company
when browsing the partner, to get the correct pricelist,
from the right company. Otherwise, it take the pricelist
from the `SUPERUSER` company (when running the schedulers/cron),
which can be different than the procurement company.
The same as to be applied when browsing the product,
as the `standard_price` field (Cost Price) is a property
as well, and can be different according to the company,
in order to get the correct price unit on the purchase
order line, from the correct company.
Fixes#5329Closes#5330
When using phantom/kit boms,
`action_confirm` on the move can lead to the move unlink,
as new moves with the different parts of the product have
been created.
See `_action_explode` in `mrp/stock.py`
The method `action_confirm` on `stock.move` returns the list
of remaining moves.
`force_assign` should therefore be performed on this new
moves list, returned by `action_confirm`, rather than
be performed on the moves list sent to `action_confirm`
opw-660722
When adding a line in a PO with the SUPERUSER_ID all the record rules
didn't apply on him. Then all the supplier taxes set on the product
were written in the PO line even if some of its were not in the company
of the user. Then with the SUPERUSER_ID, just the company taxes of this
user must be applied. Inspired from product_id_change in model
'sale.order.line'.
opw:659236
When a make to order product is sold, a purchase order is created or added to an
existing one. In the second case, the origin of the sale order was lost.
It is now added to the existing source.
opw 656688
The drop ship address was missing from the view, making impossible to
specify the address where the products needed to be delivered.
The fix adds the missing field to the view, and make it visible (and
required) if the delivery must be done at a customer location.
opw-657054
When a PO is created from a procurement, the field product_id of the
supplierinfo is not taken into account when the possible vendors are
chosen. For example, let's take the following situation:
- A product with 2 variants (color White and Black), route MTO
- Two vendors are created, one for color white, the other for color
black
- When a SO containing the 2 variants is created, only one PO for the
same vendor is created for both products.
With this fix, 2 POs will be created, linking the appropriate vendor and
variant.
opw-657362
This commit splits the changes which affect the product_id and the
changes which affect the product quantity. The main reason is that a
product change should trigger the recalculation of the price unit,
while a change in the quantity should not trigger product-specific data
recalculation (such as the name or the taxes).
The original issue was the following:
- set a supplier for a product with a minimum quantity larger than 1.0
- create a PO for this supplier and this product: since the minimum
quantity is not met, no tax is set on the line.
- change the quantity to the minimum quantity of the supplier
- the tax is set on the line, but a warning pop up confuses the user by
asking if it is necessary to discard the line since Odoo and the user
changed the same line.
This commit prevents this warning, and moreover it will set the taxes on
the product right away.
Bonus: if you change the product of an existing line, it will not keep
the privious quantity/price values, which was the case before.
opw-656729
This commit introduces the suggestion of a minimum quantity for the
chosen vendor. The minimum quantity is suggested only if the quantity on
the line is zero. It still allows the user to set a quantity smaller
than the minimum quantity for the given vendor.
opw-654300
When a PO is imported, convert the prices in the currency of the
invoice. Moreover, an onchange on the currency will recalculate the
prices if necessary.
opw-656762
The field `product_qty` contains the normalized quantity, while
`product_uom_qty` contains the actual requested quantity in the UoM of
the PO line.
opw-654318