When we enable in the settings 'Get 2 levels of approvals' with a
'Double validation amount', and then create a request for quotation.
When we confirm it, even if the total amount of the request for
quotation is below the amount set in the settings, the purchase order
needs to be approved.
We excpect that if a purchase order has a total amount below the
validation amount setting, the purchase order is automatically
confirmed.
So to fix it, we compare the amount when the user click on the button
confirm. And immediatly call the function 'button_approve' if the amount
is below the double validation amount set in settings.
Bug introduced in rev: https://github.com/odoo/odoo/commit/9d4efc81a
opw - 694381
In procurement form view display a Purchases stat button that redirects to
the purchase order. It opens the PO form view. Note that Purchase Order field
in Extra Information is left untouched. It is just a shortcut to ease
usability.
When increasing the amount on a confirmed purchase order line,
an extra move is created in the incoming picking.
When the purchase creates the moves in the picking on confirmation, it takes into account
the procurements that triggered the purchase order and creates a move for every procurement.
This is necessary in order to make the next steps ready.
With this commit, when you increase the quantity, it will take into account the amounts of moves
already created for a procurement and not link the new move with a procurement if not necessary.
This case can be tested by confirming the PO with less than foreseen by the procurements and increasing
the amount afterwards. (which is more of a corner case, but it is good to do things right)
=======
Purpose
=======
The company form should be heavily simplified. It's complex to have some settings on the company form, and others on the Settings menu of the related app. It would be much easier to have all settings in Settings menu (res.config) and nothing on the company, even if some of the Settings are multi company. (Stored on the company but set from the Settings menu).