Odoo Help


problem while overriding method from another class v8

Rahul Nimgade
on 8/10/16, 2:29 AM 157 views

Hello All,

i want to use _create_invoices method  from

'sale_advance_payment_inv' class

in my new 'create_invoice_customer' that is inherrited by sales.order,so i have written the code but its not working it give an error like

NameError: global name 'sale_advance_payment_inv' is not defined

here is my code

from openerp import api, fields, models, _

class create_invoice_customer(models.Model):


_description ="create invoice for customer"


def create(self,vals):

res = super(sale_advance_payment_inv, self)


res=self.browse(cr, uid, ids[0], context=context)

return res

and my xml file



<record id="new_button_id" model="ir.ui.view">

<field name="name">new_logic.sale</field>

<field name="model">sale.order</field>

<field name="inherit_id" ref="sale.view_order_form"/>

<field name="arch" type="xml">

<xpath expr="//field[@name='partner_id']" position="after">

<field name="make1"/>






i have search many but still not getting proper answer please any one help me....

Hey hii Pawan..thanks for reasponce but its still not working

Rahul Nimgade
on 8/10/16, 8:51 AM
Rahul Nimgade
On 8/10/16, 8:59 AM

hey hii Pawan, thank you for the reasponce

my question is i have create one 'make1'(boolean field) by inheriting sale.order...so when i select customer from sales order at that time if i clicked on make1 field so it will triiger out and make invoice for customer

please do some help



| 4 4 5
Hyderabad, India

On 8/10/16, 8:42 AM


ust replace "sale_advance_payment_inv" with "create_invoice_customer", as in super calling you have to pass the class name, and here your class name is "create_invoice_customer" and it will call the super of create() for "sale.order" object only!!

This should solve your problem    

Your Answer

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/10/16, 2:29 AM
Seen: 157 times
Last updated: 8/10/16, 8:59 AM