Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I'm working on stock.picking.out wich inherits by prototype from stock.picking, So , i want to add a field on stock.picking.out, the inheritance by prototype says that every field added on stock.picking.out is not recognized by views, and that's what hapenning with me I guess.
Because I added a field num_bl on stock.picking.out (By custom module), and I overwrite a method of stock.picking (force_assign), so I have now the following elements added to stock.picking.out, like this :
_name = "stock.picking.out"
_inherit = "stock.picking"
_table = "stock_picking"
_description = "Delivery Orders"
# Columns and other methods here #
def force_assign(self, cr, uid, ids, *args):
picking = self.browse(cr, uid, ids)
num_bl = picking.num_bl
if not num_bl:
raise osv.except_osv(_('Attention !'), _('Numero BL est un champ obligatoire ! '))
return super(stock_picking_out, self).force_assign(self, cr, uid, ids, *args)
When running the force_assign overriden method, it shows following error Attribute error : Num_bl, it dosn't recognize the field num_bl, because of inheritance by prototype.
When I add the field num_bl manually ( direclty on source code without custom module) on stock_picking, it works, but it affects other databases, so I tried to add it on stock_picking with a custom module, but it shows only on the view_picking_form view, of stock_picking.
I am kind of confused, I'm looking for a solution that provides me adding the field on the stock_picking model (By custom module), exactly if I did it manually (direclty on the source code).
Any suggestions please ?
I want inherit "prototype inheritance " a customer fracture view from accounting model to another custom module that i called test!but it doesn't work!!can anybody help me please!this is my code:
_name = 'test.test'
_inherit = 'account.invoice'
de = fields.Text(string='Des', required=True)
and the xml :
<record id="invoice_tree" model="ir.ui.view">
<field name="inherit_id" ref="account.invoice_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field name="de" /> </field> </field> </record>
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
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 12/2/14, 10:16 AM|
|Seen: 872 times|
|Last updated: 6/2/15, 7:19 AM|