If some required fields are not present in the created values, they are computed
based on the onchange.
This was introduced at 5c4765130 to allow to import sale order lines without
specifying uom.
If sale_margin is installed, the same issue will occure as it assumes there is
a value for product_uom
Add test, courtesy of Mourad Elhadj Mimoune, Akretion
Closes#17613
``import odoo.addons.foo as bar`` doesn't seem to properly trigger the
import hook in Python 3 (it blows up on decimal_precision and
base). Thus convert *all* examples of that pattern to the more
sensible ``from odoo.addons import foo as bar``.
During the conversion to the new api,
the method `product.uom`.`_compute_price` has had its signature
changed.
Formerly, it was:
`def _compute_price(self, cr, uid, from_uom_id, price, to_uom_id=False):`
Now, it is:
`def _compute_price(self, price, to_unit):`
Basically:
- the first argument `from_uom_id` is removed, and you now should
call this method from the model record directly
- the last argument is no longer a kwargs
Some calls to this method were still done the former way:
- Some have been added during forward ports
- Some are oversights when this method has been converted to the new api
This revision corrects the calls that were still done the former way
to the new way.
opw-694871
product_uom._compute_price() is now an ensure_one multi methods, taking
a browse record as second unit. This helps simplifying and unifying the
various calls and price computation methods.