how to Inherit the product form view
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
3
Réponses
28919
Vues
how to Inherit the product form view
The following can be used to inherit the product form view.
<record id="product_normal_form_view1" model="ir.ui.view">
<field name="name">product.product.form1</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="type">form</field>
<field name="arch" type="xml">
<!-- CUSTOMIZATIONS -->
</field>
</record>
You need to get OpenERP guide for Developers
this in you python code i think should work fine
class product_product(osv.osv):
_name = 'product.product'
_inherit = 'product.product'
_columns = {
'your_field': fields.char('Your Field Name',size=50,select=True),
'your_field_2': fields.date('Your Field 2 Name', size=50, required=False),
product_product()
this code in your xml should do it
<record model="ir.ui.view" id="view_product_product_form">
<field name="name">product.product.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="your_field" select="0"/>
</field>
<field name="default_code" position="replace">
<field name="your_field_2" />
</field>
</field>
</record>
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
2
mai 23
|
4646 | ||
|
2
mars 15
|
8108 | ||
|
2
juin 25
|
1535 | ||
|
0
mars 25
|
1380 | ||
|
0
févr. 25
|
1080 |
Inheritance in model and view: https://learnopenerp.blogspot.com/2018/01/inheritance-in-models-and-views.html