Merge lp:~mikel-martin/openobject-addons/6.1-fixes-1079401 into lp:openobject-addons/6.1

Proposed by mikel
Status: Needs review
Proposed branch: lp:~mikel-martin/openobject-addons/6.1-fixes-1079401
Merge into: lp:openobject-addons/6.1
Diff against target: 34 lines (+7/-2)
1 file modified
stock/stock.py (+7/-2)
To merge this branch: bzr merge lp:~mikel-martin/openobject-addons/6.1-fixes-1079401
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+134571@code.launchpad.net

Description of the change

Fix for bug https://bugs.launchpad.net/openobject-addons/+bug/1079401

When using as invoice policy "invoice from delivery order" and you create the invoice from the "create invoice" button in the delivery order the new invoice doesn't get the default values set for the partner as payment term, payment type, fiscal position....

To post a comment you must log in.

Unmerged revisions

7068. By mikel <mikel@pcl2>

[FIX] https://bugs.launchpad.net/openobject-addons/+bug/1079401

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock/stock.py'
--- stock/stock.py 2012-10-05 07:47:57 +0000
+++ stock/stock.py 2012-11-15 22:58:21 +0000
@@ -1099,7 +1099,12 @@
1099 else:1099 else:
1100 invoice_vals = self._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context)1100 invoice_vals = self._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context)
1101 invoice_id = invoice_obj.create(cr, uid, invoice_vals, context=context)1101 invoice_id = invoice_obj.create(cr, uid, invoice_vals, context=context)
1102 invoice = invoice_obj.browse(cr, uid, invoice_id)
1102 invoices_group[partner.id] = invoice_id1103 invoices_group[partner.id] = invoice_id
1104 #Call onchange_partner to get partners default values
1105 result = invoice_obj.onchange_partner_id(cr, uid, invoice_id, invoice.type, invoice.partner_id.id, invoice.date_invoice, invoice.payment_term, invoice.partner_bank_id, invoice.company_id.id)
1106 invoice_obj.write(cr, uid, invoice_id, result['value'])
1107
1103 res[picking.id] = invoice_id1108 res[picking.id] = invoice_id
1104 for move_line in picking.move_lines:1109 for move_line in picking.move_lines:
1105 if move_line.state == 'cancel':1110 if move_line.state == 'cancel':
@@ -1280,7 +1285,7 @@
1280 {1285 {
1281 'product_qty' : move.product_qty - partial_qty[move.id],1286 'product_qty' : move.product_qty - partial_qty[move.id],
1282 'product_uos_qty': move.product_qty - partial_qty[move.id], #TODO: put correct uos_qty1287 'product_uos_qty': move.product_qty - partial_qty[move.id], #TODO: put correct uos_qty
1283 1288
1284 })1289 })
12851290
1286 if new_picking:1291 if new_picking:
@@ -1382,7 +1387,7 @@
1382 name = '%s [%s]' % (name, record['ref'])1387 name = '%s [%s]' % (name, record['ref'])
1383 res.append((record['id'], name))1388 res.append((record['id'], name))
1384 return res1389 return res
1385 1390
1386 def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):1391 def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
1387 args = args or []1392 args = args or []
1388 ids = []1393 ids = []