Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3824 Widoki

How to show particular purchase order total price in my custom module I am creating a function for show amount_total iin 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>
Awatar
Odrzuć
Autor Najlepsza odpowiedź

use related field

'purchase_order':fields.related('purchase_id', 'custom_field' relation=purchase.order................................)

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
mar 15
7214
1
kwi 17
3085
1
sty 16
3642
1
paź 15
3637
2
wrz 15
7329