Reviewers: ,
Please review this at http://codereview.tryton.org/856002/
Affected files:
M move.py
Index: move.py
===================================================================
--- a/move.py
+++ b/move.py
@@ -207,6 +207,34 @@
# Add index on create_date
table.index_action('create_date', action='add')
+ @property
+ def raw_quantity(self):
+ pool = Pool()
+ Uom = Pool().get('product.uom')
+ return Uom.compute_qty(self.uom, self.quantity,
+ self.product.default_uom, round=False)
+
+ @raw_quantity.setter
+ def raw_quantity(self, quantity):
+ pool = Pool()
+ Uom = Pool().get('product.uom')
+ self.quantity = Uom.compute_qty(self.product.default_uom, quantity,
+ self.uom, round=False)
+
+ @property
+ def raw_unit_price(self):
+ pool = Pool()
+ Uom = Pool().get('product.uom')
+ return Uom.compute_price(self.uom, self.unit_price,
+ self.product.default_uom)
+
+ @raw_unit_price.setter
+ def raw_unit_price(self, price):
+ pool = Pool()
+ Uom = Pool().get('product.uom')
+ self.unit_price = Uom.compute_price(self.product.default_uom, price,
+ self.uom)
+
@staticmethod
def default_planned_date():
return Transaction().context.get('planned_date')