parent
e9ee812165
commit
429afac3cc
|
@ -206,7 +206,12 @@ class account_invoice(osv.osv):
|
|||
'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',
|
||||
help='The bank account to pay to or to be paid from'),
|
||||
'move_lines':fields.function(_get_lines , method=True,type='many2many' , relation='account.move.line',string='Move Lines'),
|
||||
'residual': fields.function(_amount_residual, method=True, digits=(16,2),string='Residual', store=True, help="Remaining amount due."),
|
||||
'residual': fields.function(_amount_residual, method=True, digits=(16,2),string='Residual',
|
||||
store={
|
||||
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 12),
|
||||
'account.invoice.tax': (_get_invoice_tax, None, 12),
|
||||
},
|
||||
help="Remaining amount due."),
|
||||
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
|
||||
'move_name': fields.char('Account Move', size=64),
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class account_invoice_line(osv.osv):
|
|||
}
|
||||
if not line.quantity:
|
||||
continue
|
||||
if line.invoice_id and line.invoice_id.price_type == 'tax_included':
|
||||
if line.invoice_id:
|
||||
product_taxes = []
|
||||
if line.product_id:
|
||||
if line.invoice_id.type in ('out_invoice', 'out_refund'):
|
||||
|
@ -63,7 +63,7 @@ class account_invoice_line(osv.osv):
|
|||
else:
|
||||
product_taxes = filter(lambda x: x.price_include, line.product_id.supplier_taxes_id)
|
||||
|
||||
if (set(product_taxes) == set(line.invoice_line_tax_id)) or not product_taxes:
|
||||
if ((set(product_taxes) == set(line.invoice_line_tax_id)) or not product_taxes) and (line.invoice_id.price_type == 'tax_included'):
|
||||
res[line.id]['price_subtotal_incl'] = res_init[line.id]
|
||||
else:
|
||||
res[line.id]['price_subtotal'] = res_init[line.id]
|
||||
|
|
Loading…
Reference in New Issue