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
1=== modified file 'l10n_it_partially_deductible_vat/AUTHORS.txt'
2--- l10n_it_partially_deductible_vat/AUTHORS.txt 2011-11-06 11:25:21 +0000
3+++ l10n_it_partially_deductible_vat/AUTHORS.txt 2012-10-11 08:54:57 +0000
4@@ -1,1 +1,2 @@
5 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
6+Franco Tampieri <franco.tampieri@agilebg.com>
7
8=== modified file 'l10n_it_partially_deductible_vat/account.py'
9--- l10n_it_partially_deductible_vat/account.py 2012-07-17 06:49:33 +0000
10+++ l10n_it_partially_deductible_vat/account.py 2012-10-11 08:54:57 +0000
11@@ -31,7 +31,7 @@
12 class account_tax(osv.osv):
13
14 _inherit = 'account.tax'
15-
16+
17 def _have_same_rate(self, account_taxes):
18 rate = None
19 for account_tax in account_taxes:
20@@ -46,7 +46,7 @@
21 return tax
22 else:
23 return self.get_main_tax(tax.parent_id)
24-
25+
26 def get_account_tax_by_tax_code(self, tax_code):
27 if tax_code.tax_ids:
28 if not self._have_same_rate(tax_code.tax_ids):
29@@ -60,7 +60,7 @@
30 return tax_code.ref_tax_ids[0]
31 raise osv.except_osv(_('Error'),
32 _('No taxes associated to tax code %s') % str(tax_code.name))
33-
34+
35 def get_account_tax_by_base_code(self, tax_code):
36 if tax_code.base_tax_ids:
37 if not self._have_same_rate(tax_code.base_tax_ids):
38@@ -75,9 +75,9 @@
39 raise osv.except_osv(_('Error'),
40 _('No taxes associated to tax code %s') % str(tax_code.name))
41
42- def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None):
43+ def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, force_excluded=False):
44 res = super(account_tax, self).compute_all(cr, uid, taxes, price_unit, quantity, address_id, product, partner)
45-
46+
47 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
48 tax_list = res['taxes']
49 totalex = res['total']
50@@ -101,10 +101,10 @@
51 class account_invoice_tax(osv.osv):
52
53 _inherit = "account.invoice.tax"
54-
55+
56 '''
57 tax_grouped:
58-
59+
60 {(False, 21, 132): {'account_id': 132,
61 'amount': 12.36,
62 'base': 61.79,
63@@ -139,7 +139,7 @@
64 'tax_amount': 24.71,
65 'tax_code_id': 26}}
66 '''
67-
68+
69 def tax_difference(self, cr, uid, cur, tax_grouped):
70 real_total = 0
71 invoice_total = 0
72@@ -215,12 +215,12 @@
73 inv_tax['tax_amount'] = cur_obj.round(cr, uid, cur, inv_tax['tax_amount'])
74 inv_tax_2['amount'] = cur_obj.round(cr, uid, cur, inv_tax_2['amount'])
75 return tax_grouped
76-
77+
78
79 class account_tax_code(osv.osv):
80
81 _inherit = 'account.tax.code'
82-
83+
84 _columns = {
85 'base_tax_ids': fields.one2many('account.tax', 'base_code_id', 'Base Taxes'),
86 'tax_ids': fields.one2many('account.tax', 'tax_code_id', 'Taxes'),

Subscribers

People subscribed via source and target branches