Odoo Help

4

3
3 Answers
1
kampeons
2016/7/15 上午6:45

Try this, It will work..


@api.modeldef _prepare_invoice(self, order, lines):
 print "****************Invoice Gen*****************"
print order.order_type.name
print lines
res = super(so_form, self)._prepare_invoice(order, lines)
if lines:
    for i in lines:
        self.env['account.invoice.line'].search([('id', '=', i)]).write({'order_type': order.order_type.id, 'staff':order.staff.id})
return res
1 Comment
NIKHIL KRISHNAN
2018/8/3 上午2:49

Thanks

1
Miftahussalam
2016/7/14 上午6:14

Try this :

@api.multi
def _prepare_invoice(self, order, lines):
    self.env['account.invoice.line'].write(self._cr, self._uid, lines, {'order_type': order.order_type.id, 'staff': order.staff.id})
 return super(so_form, self)._prepare_invoice(order, lines)
1 Comment
NIKHIL KRISHNAN
2018/8/3 上午2:49

Thanks

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register