132
132
Then I create an invoice from picking by clicking on "Create Invoice" wizard
134
134
!python {model: stock.invoice.onshipping}: |
135
136
pur_obj=self.pool.get('purchase.order')
136
137
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2"))
137
138
pick_ids = [x.id for x in pur_id1.picking_ids]
138
id = self.create(cr, uid, {'invoice_date': '2010-05-11', 'journal_id': ref('account.expenses_journal')},
139
id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.expenses_journal')},
139
140
{'active_ids': pick_ids})
140
141
self.create_invoice(cr, uid, [id], {"active_ids": pick_ids, "active_id": pick_ids[0]})