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

Hi, I have to migrate a custom module from V8 to V9 but I've a problem: I have this sample code (procurement.py) in version 8.0 to automaticaly generate a PO when a Sale Order is confirmed but I don't know how to edit it to work in version 9.0

class procurement_order(osv.osv):

_inherit = 'procurement.order'

_columns = {

'analytic_account_id' : fields.many2one('account.analytic.account','Compte Analytique'),

}

def make_po(self, cr, uid, ids, context=None):

res = super(procurement_order,self).make_po(cr, uid, ids, context)

po_line=res[ids[0]]

if po_line:

for procurement in self.browse(cr, uid, ids, context):

self.pool.get('purchase.order.line').write(cr,uid,po_line,{'name':procurement.name,'account_analytic_id':procurement.analytic_account_id.id})

return res

procurement_order()

In advance, thanks.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

The problem is that I overwrited the function make_po.


If not, the PO is automatically created after the confirmation of a PO.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 3 16
5398
1
thg 3 16
3865
0
thg 3 15
4604
1
thg 12 15
4619
2
thg 10 20
2251