Good day, I am developing a module that registers quarterly earnings in an account of an employee, I have a column that records the accumulated income, for this I must add the new entry to accumulated earnings, how I can do this? I'm working with OpenERP 7
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
Hi ,
you can add the custom field by using inheritance.B
In the .py file:
class your_first_model(orm.Model):
_name="first.model"
_columns={
'your_field1':fields.char('New Field1')
}
class your_second_model(orm.Model):
_name="second.model"
_inherit="first.model"
_columns={
'your_field2':fields.char('New Field2')
}
in the xml view:
<record id="your_first_model_form" model="ir.ui.view">
<field name="name">your.first,model</field>
<field name="model">first.model</field>
<form string="sample">
<field name="your_field1" />
</form>
</field>
</rec
<record id="your_second_model_form__inherit" model="ir.ui.view">
<field name="name">your.second.model_</field>
<field name="model">second.model</field>
<field name="inherit_id" ref="your_first_model_form"/>
<field name="your_field1" position="after">
<field name="your_field2" />
</field>
</field>
</record>
Not working
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden