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
  •  | 
  •  

Question

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>
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top