product_sale_price_from_pricelist: don't update list_price when last_purchase_price_compute_type == manual_update. Add fields to tree product view
This commit is contained in:
parent
969cc9e9f5
commit
7df39dbda8
2 changed files with 15 additions and 2 deletions
|
|
@ -115,8 +115,9 @@ class ProductTemplate(models.Model):
|
||||||
|
|
||||||
def action_update_list_price(self):
|
def action_update_list_price(self):
|
||||||
for template in self:
|
for template in self:
|
||||||
template.list_price = template.list_price_theoritical
|
if template.last_purchase_price_compute_type != "manual_update":
|
||||||
template.last_purchase_price_updated = False
|
template.list_price = template.list_price_theoritical
|
||||||
|
template.last_purchase_price_updated = False
|
||||||
|
|
||||||
def price_compute(
|
def price_compute(
|
||||||
self, price_type, uom=None, currency=None, company=False, date=False
|
self, price_type, uom=None, currency=None, company=False, date=False
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,18 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="product_view_inherit_tree_price_auto" model="ir.ui.view">
|
||||||
|
<field name="name">product.template.tree.price.automatic</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_tree_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='list_price']" position="after">
|
||||||
|
<field name="list_price_theoritical" optional="hide"/>
|
||||||
|
<field name="last_purchase_price_received" optional="hide"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="res_config_settings_view_form_pricelists" model="ir.ui.view">
|
<record id="res_config_settings_view_form_pricelists" model="ir.ui.view">
|
||||||
<field name="name">product.print.supermarket.res.config.settings.form</field>
|
<field name="name">product.print.supermarket.res.config.settings.form</field>
|
||||||
<field name="model">res.config.settings</field>
|
<field name="model">res.config.settings</field>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue