Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3830 Lượt xem

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>
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

use related field

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
7221
1
thg 4 17
3089
1
thg 1 16
3644
1
thg 10 15
3639
2
thg 9 15
7331