credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #00099
[Merge] lp:~credativ/openobject-addons/lp-889106 into lp:openobject-addons
Dmitrijs Ledkovs (credativ) has proposed merging lp:~credativ/openobject-addons/lp-889106 into lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #889106 in OpenERP Addons: "[trunk,6.0] supplier invoice, default price suggested should exclude VAT"
https://bugs.launchpad.net/openobject-addons/+bug/889106
For more details, see:
https://code.launchpad.net/~credativ/openobject-addons/lp-889106/+merge/81987
[IMP] account: on product change suggest unit_price without VAT included
--
https://code.launchpad.net/~credativ/openobject-addons/lp-889106/+merge/81987
Your team credativ is subscribed to branch lp:~credativ/openobject-addons/lp-889106.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2011-11-10 22:58:02 +0000
+++ account/account_invoice.py 2011-11-11 14:19:08 +0000
@@ -1353,6 +1353,17 @@
taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
+ if type in ('in_invoice','in_refund') and tax_id and price_unit:
+ tax_pool = self.pool.get('account.tax')
+ tax_browse = tax_pool.browse(cr, uid, tax_id)
+ if not isinstance(tax_browse, list):
+ tax_browse = [tax_browse]
+ taxes = tax_pool.compute_inv(cr, uid, tax_browse, price_unit, 1)
+ tax_amount = reduce(lambda total, tax_dict: total + tax_dict.get('amount', 0.0), taxes, 0.0)
+ price_unit = price_unit - tax_amount
+ if qty != 0:
+ price_unit = price_unit / float(qty)
+
if type in ('in_invoice', 'in_refund'):
result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} )
else:
Follow ups