Override values even when they are empty (a user may empty a value on a sale order or purchase order and would like the empty field to be "copied" on the invoice).

bzr revid: alexis@via.ecp.fr-20120116141643-boglddgratoro59p
This commit is contained in:
Alexis de Lattre
2012-01-16 15:16:43 +01:00
parent 1f9401bf41
commit da9d506349
2 changed files with 4 additions and 8 deletions
+1 -2
View File
@@ -72,8 +72,7 @@ class stock_picking(osv.osv):
invoice_vals['address_contact_id'], invoice_vals['address_invoice_id'] = \
self.pool.get('res.partner').address_get(cr, uid, [partner.id],
['contact', 'invoice']).values()
if picking.purchase_id.fiscal_position:
invoice_vals['fiscal_position'] = picking.purchase_id.fiscal_position.id
invoice_vals['fiscal_position'] = picking.purchase_id.fiscal_position.id
return invoice_vals
def get_currency_id(self, cursor, user, picking):
+3 -6
View File
@@ -66,12 +66,9 @@ class stock_picking(osv.osv):
if picking.sale_id:
invoice_vals['address_contact_id'] = picking.sale_id.partner_order_id.id
invoice_vals['address_invoice_id'] = picking.sale_id.partner_invoice_id.id
if picking.sale_id.fiscal_position:
invoice_vals['fiscal_position'] = picking.sale_id.fiscal_position.id
if picking.sale_id.payment_term:
invoice_vals['payment_term'] = picking.sale_id.payment_term.id
if picking.sale_id.user_id:
invoice_vals['user_id'] = picking.sale_id.user_id.id
invoice_vals['fiscal_position'] = picking.sale_id.fiscal_position.id
invoice_vals['payment_term'] = picking.sale_id.payment_term.id
invoice_vals['user_id'] = picking.sale_id.user_id.id
return invoice_vals
def _get_price_unit_invoice(self, cursor, user, move_line, type):