[REF] Review the form views
[odoo/odoo.git] / addons / product / test / product_uom.yml
1 -
2   In order to test conversation of UOM,
3 -
4   I convert Grams into TON with price.
5 -
6   !python {model: product.uom}: |
7     from_uom_id = ref("product_uom_gram")
8     to_uom_id = ref("product_uom_ton")
9     price = 2
10     qty = 1020000
11     price = self._compute_price(cr, uid, from_uom_id, price, to_uom_id)
12     qty = self._compute_qty(cr, uid, from_uom_id, qty, to_uom_id)
13     assert qty == 1.02, "Qty is not correspond."
14     assert price == 2000000.0, "Price is not correspond."
15