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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký