Add symbol widget
issue9059 review276871002
This commit is contained in:
1 parent
929b1c1765
commit
453be81088
3 files changed
+10
-4
No files matched your search
@@ -58,6 +58,8 @@ class PurchaseRequest(ModelSQL, ModelView):
|
||||
readonly=True)
|
||||
purchase_date = fields.Date('Best Purchase Date', readonly=True)
|
||||
supply_date = fields.Date('Expected Supply Date', readonly=True)
|
||||
default_uom = fields.Function(fields.Many2One(
|
||||
'product.uom', "Default UOM"), 'on_change_with_default_uom')
|
||||
default_uom_digits = fields.Function(fields.Integer('Default UOM Digits'),
|
||||
'on_change_with_default_uom_digits')
|
||||
stock_level = fields.Float('Stock at Supply Date', readonly=True,
|
||||
@@ -268,6 +270,11 @@ class PurchaseRequest(ModelSQL, ModelView):
|
||||
if self.product:
|
||||
return self.product.default_uom_category.id
|
||||
|
||||
@fields.depends('product')
|
||||
def on_change_with_default_uom(self, name=None):
|
||||
if self.product:
|
||||
return self.product.default_uom.id
|
||||
|
||||
@fields.depends('product')
|
||||
def on_change_with_default_uom_digits(self, name=None):
|
||||
if self.product:
|
||||
|
||||
@@ -35,7 +35,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<label name="purchase"/>
|
||||
<field name="purchase"/>
|
||||
<label name="stock_level"/>
|
||||
<field name="stock_level"/>
|
||||
<field name="stock_level" symbol="default_uom"/>
|
||||
<label name="origin"/>
|
||||
<field name="origin"/>
|
||||
</page>
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tree>
|
||||
<field name="product" expand="2"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uom"/>
|
||||
<field name="quantity" symbol="uom"/>
|
||||
<field name="warehouse" expand="1"/>
|
||||
<field name="party" expand="2"/>
|
||||
<field name="purchase_date"/>
|
||||
<field name="stock_level"/>
|
||||
<field name="stock_level" symbol="default_uom"/>
|
||||
<field name="company" expand="1"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
Reference in new issue
Block a user