You may try like this:
from openerp import models, fields, api
_inherit = 'product.template'
model_mat = fields.Char('Model de materiel')
num_ligne = fields.Integer('N° ligne')
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page" position="inside">
And please note when you inherit multiple models, use _inherits instead of _inherit.
it worked thankyou,but only after seperating classes in other py file, if I may say that the reason why it was not working earlier is that I have declared 2 classes in the same .py file using different objects and importing from different classes the first one using osv.osv the other one using models.Model and when importing each one's fields there happens the Conflict between the two classes because one is declaring a field.Char and the other one is using field.char which causes "as I think" this error that it was giving me : odoo AttributeError: 'module' object has no attribute 'char'
so I was doing like this in same file which is uncorrect I think
from openerp import models, fields, api from openerp.osv import fields, osv
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/12/16, 5:46 AM|
|Seen: 1794 times|
|Last updated: 1/15/16, 4:22 AM|