Merge lp:~dr.dran/openobject-italia/fix_for_account_move_template into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-6.1

Proposed by Franco Tampieri
Status: Merged
Merged at revision: 203
Proposed branch: lp:~dr.dran/openobject-italia/fix_for_account_move_template
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-6.1
Diff against target: 86 lines (+11/-10)
2 files modified
l10n_it_partially_deductible_vat/AUTHORS.txt (+1/-0)
l10n_it_partially_deductible_vat/account.py (+10/-10)
To merge this branch: bzr merge lp:~dr.dran/openobject-italia/fix_for_account_move_template
Reviewer Review Type Date Requested Status
OpenERP Italia core devs Pending
Review via email: mp+129119@code.launchpad.net

Description of the change

[Fix] Aggiunta patch per risolvere il problema sul metoo compute_all()

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'l10n_it_partially_deductible_vat/AUTHORS.txt'
--- l10n_it_partially_deductible_vat/AUTHORS.txt 2011-11-06 11:25:21 +0000
+++ l10n_it_partially_deductible_vat/AUTHORS.txt 2012-10-11 08:54:57 +0000
@@ -1,1 +1,2 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
2Franco Tampieri <franco.tampieri@agilebg.com>
23
=== modified file 'l10n_it_partially_deductible_vat/account.py'
--- l10n_it_partially_deductible_vat/account.py 2012-07-17 06:49:33 +0000
+++ l10n_it_partially_deductible_vat/account.py 2012-10-11 08:54:57 +0000
@@ -31,7 +31,7 @@
31class account_tax(osv.osv):31class account_tax(osv.osv):
3232
33 _inherit = 'account.tax'33 _inherit = 'account.tax'
34 34
35 def _have_same_rate(self, account_taxes):35 def _have_same_rate(self, account_taxes):
36 rate = None36 rate = None
37 for account_tax in account_taxes:37 for account_tax in account_taxes:
@@ -46,7 +46,7 @@
46 return tax46 return tax
47 else:47 else:
48 return self.get_main_tax(tax.parent_id)48 return self.get_main_tax(tax.parent_id)
49 49
50 def get_account_tax_by_tax_code(self, tax_code):50 def get_account_tax_by_tax_code(self, tax_code):
51 if tax_code.tax_ids:51 if tax_code.tax_ids:
52 if not self._have_same_rate(tax_code.tax_ids):52 if not self._have_same_rate(tax_code.tax_ids):
@@ -60,7 +60,7 @@
60 return tax_code.ref_tax_ids[0]60 return tax_code.ref_tax_ids[0]
61 raise osv.except_osv(_('Error'),61 raise osv.except_osv(_('Error'),
62 _('No taxes associated to tax code %s') % str(tax_code.name))62 _('No taxes associated to tax code %s') % str(tax_code.name))
63 63
64 def get_account_tax_by_base_code(self, tax_code):64 def get_account_tax_by_base_code(self, tax_code):
65 if tax_code.base_tax_ids:65 if tax_code.base_tax_ids:
66 if not self._have_same_rate(tax_code.base_tax_ids):66 if not self._have_same_rate(tax_code.base_tax_ids):
@@ -75,9 +75,9 @@
75 raise osv.except_osv(_('Error'),75 raise osv.except_osv(_('Error'),
76 _('No taxes associated to tax code %s') % str(tax_code.name))76 _('No taxes associated to tax code %s') % str(tax_code.name))
7777
78 def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None):78 def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, force_excluded=False):
79 res = super(account_tax, self).compute_all(cr, uid, taxes, price_unit, quantity, address_id, product, partner)79 res = super(account_tax, self).compute_all(cr, uid, taxes, price_unit, quantity, address_id, product, partner)
80 80
81 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')81 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
82 tax_list = res['taxes']82 tax_list = res['taxes']
83 totalex = res['total']83 totalex = res['total']
@@ -101,10 +101,10 @@
101class account_invoice_tax(osv.osv):101class account_invoice_tax(osv.osv):
102102
103 _inherit = "account.invoice.tax"103 _inherit = "account.invoice.tax"
104 104
105 '''105 '''
106 tax_grouped:106 tax_grouped:
107 107
108 {(False, 21, 132): {'account_id': 132,108 {(False, 21, 132): {'account_id': 132,
109 'amount': 12.36,109 'amount': 12.36,
110 'base': 61.79,110 'base': 61.79,
@@ -139,7 +139,7 @@
139 'tax_amount': 24.71,139 'tax_amount': 24.71,
140 'tax_code_id': 26}}140 'tax_code_id': 26}}
141 '''141 '''
142 142
143 def tax_difference(self, cr, uid, cur, tax_grouped):143 def tax_difference(self, cr, uid, cur, tax_grouped):
144 real_total = 0144 real_total = 0
145 invoice_total = 0145 invoice_total = 0
@@ -215,12 +215,12 @@
215 inv_tax['tax_amount'] = cur_obj.round(cr, uid, cur, inv_tax['tax_amount'])215 inv_tax['tax_amount'] = cur_obj.round(cr, uid, cur, inv_tax['tax_amount'])
216 inv_tax_2['amount'] = cur_obj.round(cr, uid, cur, inv_tax_2['amount'])216 inv_tax_2['amount'] = cur_obj.round(cr, uid, cur, inv_tax_2['amount'])
217 return tax_grouped217 return tax_grouped
218 218
219219
220class account_tax_code(osv.osv):220class account_tax_code(osv.osv):
221221
222 _inherit = 'account.tax.code'222 _inherit = 'account.tax.code'
223 223
224 _columns = {224 _columns = {
225 'base_tax_ids': fields.one2many('account.tax', 'base_code_id', 'Base Taxes'),225 'base_tax_ids': fields.one2many('account.tax', 'base_code_id', 'Base Taxes'),
226 'tax_ids': fields.one2many('account.tax', 'tax_code_id', 'Taxes'),226 'tax_ids': fields.one2many('account.tax', 'tax_code_id', 'Taxes'),

Subscribers

People subscribed via source and target branches