콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
2424 화면

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):

_inherit="sale.order"

_description ="create invoice for customer"

@api.model

def create(self,vals):

res = super(sale_advance_payment_inv, self)

res._create_invoices

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

return res


and my xml file

<openerp>

<data>

<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"/>

</xpath>

</field>

</record>

</data>

</openerp>


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

작성자 베스트 답변

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

아바타
취소
베스트 답변

Rahul,

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    

아바타
취소