product_template.xml
the view to add the customizing field to the product module
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="product_template_only_form_view_inherit" model="ir.ui.view">
<field name="name">product.template.common.form</field>
<field name="model">product.template</field>
<field name="inherit_id"
ref="product.product_template_only_form_view " />
<field name="arch" type="xml">
<xpath expr="//field[@name='list_price']" position="after">
<field name="list_price"/>
</xpath>
</field>
</record>
</data>
</odoo>
models file python
product_template.py
-- coding: utf-8 --
from odoo import models, fields , api
from odoo.addons import decimal_precision as dp
from odoo.exceptions import ValidationError, RedirectWarning, except_orm
from odoo.tools import pycompat
class ProductTemplate(models.Model):
_inherit = 'product.template'
_name = 'product.template'
_columns={
'remise': fields.float('remise du fournisseur', size=10, required=True),
'marge': fields.float('marge', size=10, required=True),
'total_reste': fields.float('Reste', size=10, required=True),
}
remise = fields.float('remise du fournisseur', size=10, required=True)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…