Browse Source

[FIX] compute_purchase_order: fields renamed in beesdoo_stock_coverage

pull/145/head
Vincent Van Rossem 5 years ago
committed by robin.keunen
parent
commit
e51e22f756
  1. 8
      compute_purchase_order/models/computed_purchase_order_line.py
  2. 2
      compute_purchase_order/views/computed_purchase_order.xml
  3. 2
      compute_purchase_order/views/product_template.xml

8
compute_purchase_order/models/computed_purchase_order_line.py

@ -61,14 +61,14 @@ class ComputedPurchaseOrderLine(models.Model):
help='Virtual quantity taking into account current stock, incoming ' help='Virtual quantity taking into account current stock, incoming '
'orders and outgoing sales.') 'orders and outgoing sales.')
average_consumption = fields.Float(
daily_sales = fields.Float(
string='Average Consumption', string='Average Consumption',
related='product_template_id.average_consumption',
related='product_template_id.daily_sales',
read_only=True) read_only=True)
stock_coverage = fields.Float( stock_coverage = fields.Float(
string='Stock Coverage', string='Stock Coverage',
related='product_template_id.estimated_stock_coverage',
related='product_template_id.stock_coverage',
read_only=True, read_only=True,
) )
@ -123,7 +123,7 @@ class ComputedPurchaseOrderLine(models.Model):
def _depends_on_purchase_quantity(self): def _depends_on_purchase_quantity(self):
for cpol in self: for cpol in self:
cpol.subtotal = cpol.product_price * cpol.purchase_quantity cpol.subtotal = cpol.product_price * cpol.purchase_quantity
avg = cpol.average_consumption
avg = cpol.daily_sales
if avg > 0: if avg > 0:
qty = ((cpol.virtual_available / cpol.uom_id.factor) qty = ((cpol.virtual_available / cpol.uom_id.factor)
+ (cpol.purchase_quantity / cpol.uom_po_id.factor)) + (cpol.purchase_quantity / cpol.uom_po_id.factor))

2
compute_purchase_order/views/computed_purchase_order.xml

@ -60,7 +60,7 @@
<field name="qty_available" readonly='1'/> <field name="qty_available" readonly='1'/>
<field name="virtual_available" readonly='1'/> <field name="virtual_available" readonly='1'/>
<field name="uom_id" readonly='1'/> <field name="uom_id" readonly='1'/>
<field name="average_consumption" readonly='1'/>
<field name="daily_sales" readonly='1'/>
<field name="stock_coverage" readonly='1'/> <field name="stock_coverage" readonly='1'/>
<field name="virtual_coverage" readonly='1'/> <field name="virtual_coverage" readonly='1'/>
<field name="product_price" readonly='1'/> <field name="product_price" readonly='1'/>

2
compute_purchase_order/views/product_template.xml

@ -12,7 +12,7 @@
<field name="name"/> <field name="name"/>
<field name="ref interne"/> <field name="ref interne"/>
<field name="supplier"/> <field name="supplier"/>
<field name="estimated_stock_coverage"/>
<field name="stock_coverage"/>
<field name="virtual_coverage"/> <field name="virtual_coverage"/>
<field name="categ_id"/> <field name="categ_id"/>
<field name="qty_available"/> <field name="qty_available"/>

Loading…
Cancel
Save