How to show particular purchase order total price in my custom module for that particular purchase order in OpenERP

StackOverflow https://stackoverflow.com/questions/21130689

  •  28-09-2022
  •  | 
  •  

문제

How to show particular purchase order total price in my custom module I am creating a function for show amount_total in my custom module but it's not showing

def create(self, cr, uid, vals, context=None):
    if vals.get('buy_back'):
        purchase_obj=self.pool.get('purchase.order')
        sequence=self.pool.get('ir.sequence').get(cr, uid, 'purchase.order')
        new_purchase=purchase_obj.create(cr, uid, {'name':sequence,'amt_total':vals.get('amount_total')}, context=context)
        import pprint
        pprint.pprint( vals )
        print 'amount_total'
        vals['purchase_order']=new_purchase
        pprint.pprint( vals )

This is my view file

                    <field name="buy_back"/>
                    <field name="purchase_order"/>
                    <fiels name="amt_total"/>
                </xpath>
도움이 되었습니까?

해결책

you can create a related field of amount_total of purchase order to show the amount_total.

Like:

when you create field

then you can make a related field like:

 'amt_total': fields.related('purchase_order', 'amount_total', type='float', string='Amount Total', store=True),

And show this field.

Hope this help

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top