Merge lp:~camptocamp/openerp-swiss-localization/7.0-add-l10n_ch_add_invoice_rounding into lp:~camptocamp/openerp-swiss-localization/7.0

Proposed by Yannick Vaucher @ Camptocamp
Status: Superseded
Proposed branch: lp:~camptocamp/openerp-swiss-localization/7.0-add-l10n_ch_add_invoice_rounding
Merge into: lp:~camptocamp/openerp-swiss-localization/7.0
Diff against target: 452 lines (+419/-0)
6 files modified
l10n_ch_invoice_rounding/__init__.py (+23/-0)
l10n_ch_invoice_rounding/__openerp__.py (+48/-0)
l10n_ch_invoice_rounding/account.py (+237/-0)
l10n_ch_invoice_rounding/company.py (+36/-0)
l10n_ch_invoice_rounding/res_config.py (+49/-0)
l10n_ch_invoice_rounding/res_config_view.xml (+26/-0)
To merge this branch: bzr merge lp:~camptocamp/openerp-swiss-localization/7.0-add-l10n_ch_add_invoice_rounding
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp Needs Information
Nicolas Bessi - Camptocamp (community) Needs Information
Review via email: mp+171359@code.launchpad.net

This proposal has been superseded by a proposal from 2014-01-14.

To post a comment you must log in.
179. By Yannick Vaucher @ Camptocamp

[FIX] l10n_ch_invoice_rounding - comparison to avoid write of added rounding invoice line

180. By Yannick Vaucher @ Camptocamp

[FIX] l10n_ch_invoice_rounding - add missing call to onchange on invoice tax line amount

181. By Yannick Vaucher @ Camptocamp

[FIX] l10n_ch_invoice_rounding - using multiple taxes the adjustment need to be made only once all taxes are computed

182. By Vincent Renaville@camptocamp

[IMP] l10n_ch_invoice_rounding - do not apply rounding for supplier invoices

183. By Vincent Renaville@camptocamp

[ADD] l10n_ch_invoice_rounding - documentation

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

Should we put this addons in account-financial-tools + a configuration addons in l10n_ch

review: Needs Information
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

It would make sense if in other countries you also have a unit different than a base of 10. Likes we do in Switzerland as our lowest unit is 5 cts.

Otherwise, if in other countries you are allowed / want to give a rounded tax amount to round your total on an other base that 10.

I couldn't found such information about this need for other countries.

review: Needs Information
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

> It would make sense if in other countries you also have a unit different than
> a base of 10. Likes we do in Switzerland as our lowest unit is 5 cts.
>
> Otherwise, if in other countries you are allowed / want to give a rounded tax
> amount to round your total on an other base that 10.
>
> I couldn't found such information about this need for other countries.

Here is an interesting link: http://en.wikipedia.org/wiki/Swedish_rounding, it may be useful for other countries with 5 øre intervals. (the 25 øre is no longer used).

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

> Hello,
>
> Should we put this addons in account-financial-tools + a configuration addons
> in l10n_ch

Guewen link shows that this module is generic -> yes let's put this into account-financial-tools + a module in l10n_ch

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Go for this one, more appropriate: https://launchpad.net/account-invoicing

Unmerged revisions

183. By Vincent Renaville@camptocamp

[ADD] l10n_ch_invoice_rounding - documentation

182. By Vincent Renaville@camptocamp

[IMP] l10n_ch_invoice_rounding - do not apply rounding for supplier invoices

181. By Yannick Vaucher @ Camptocamp

[FIX] l10n_ch_invoice_rounding - using multiple taxes the adjustment need to be made only once all taxes are computed

180. By Yannick Vaucher @ Camptocamp

[FIX] l10n_ch_invoice_rounding - add missing call to onchange on invoice tax line amount

179. By Yannick Vaucher @ Camptocamp

[FIX] l10n_ch_invoice_rounding - comparison to avoid write of added rounding invoice line

178. By Yannick Vaucher @ Camptocamp

[ADD] l10n_ch_invoice_rounding - add global precision on tax computation

177. By Yannick Vaucher @ Camptocamp

[IMP] l10n_ch_invoice_rounding - module description

176. By Yannick Vaucher @ Camptocamp

[ADD] module l10n_ch_invoice_rounding

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'l10n_ch_invoice_rounding'
=== added file 'l10n_ch_invoice_rounding/__init__.py'
--- l10n_ch_invoice_rounding/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_ch_invoice_rounding/__init__.py 2013-07-16 09:34:25 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from . import company
22from . import res_config
23from . import account
024
=== added file 'l10n_ch_invoice_rounding/__openerp__.py'
--- l10n_ch_invoice_rounding/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_ch_invoice_rounding/__openerp__.py 2013-07-16 09:34:25 +0000
@@ -0,0 +1,48 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21{'name' : 'Unit rounded invoice',
22 'version' : '1.0',
23 'category': 'Accounting',
24 'description':
25"""
26Add a parameter to give a unit for rounding such as CHF 0.05 for Swiss invoices
27
28In Settings -> Configuration -> Accounting you will find 2 new types of rounding
29`Swiss Round globally`
30To round your invoice total amount, this option will do the adjustment in the
31the most important tax line of your invoice.
32
33`Swiss Round by adding an invoice line`
34To round your invoice total amount, this option create a invoice line without
35taxes on it. This invoice line is tagged as `is_rounding`
36
37You can choose the account on which the invoice line will be written
38""",
39 'author' : 'Camptocamp',
40 'maintainer': 'Camptocamp',
41 'website': 'http://www.camptocamp.com/',
42 'depends' : ['account'],
43 'data': ['res_config_view.xml'],
44 'test': [],
45 'installable': True,
46 'auto_install': False,
47 'application': True,
48 }
049
=== added file 'l10n_ch_invoice_rounding/account.py'
--- l10n_ch_invoice_rounding/account.py 1970-01-01 00:00:00 +0000
+++ l10n_ch_invoice_rounding/account.py 2013-07-16 09:34:25 +0000
@@ -0,0 +1,237 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23from openerp.tools.float_utils import float_round, float_compare
24from openerp.tools.translate import _
25
26import openerp.addons.decimal_precision as dp
27
28def _all_invoice_tax_line_computed(invoice):
29 tax_ids = set()
30 for line in invoice.invoice_line:
31 # invoice_line_tax_id is a many2many if you wonder about it
32 for tax in line.invoice_line_tax_id:
33 if not tax.price_include:
34 tax_ids.add(tax.id)
35 computed_tax_ids = [tax.id for tax in invoice.tax_line]
36 return len(tax_ids) == len(computed_tax_ids)
37class AccountInvoice(orm.Model):
38 _inherit = "account.invoice"
39
40
41 def _l10n_ch_add_invoice_line(self, cr, uid, invoice, amounts, rounded_total, delta, context=None):
42 """Create a invoice_line with the diff of rounding"""
43 invoice_line_obj = self.pool.get('account.invoice.line')
44 obj_precision = self.pool.get('decimal.precision')
45 prec = obj_precision.precision_get(cr, uid, 'Account')
46
47 company = invoice.company_id
48 if not invoice.global_round_line_id:
49 new_invoice_line = {
50 'name': _('Rounding'),
51 'price_unit': -delta,
52 'account_id': company.tax_calculation_rounding_account_id.id,
53 'invoice_id': invoice.id,
54 'is_rounding': True,
55 }
56 round_line_id = invoice_line_obj.create(cr, uid, new_invoice_line, context=context)
57 elif float_compare(invoice.global_round_line_id.price_unit, -delta, precision_digits=prec) != 0:
58 invoice_line_obj.write(cr, uid, invoice.global_round_line_id.id, {'price_unit': -delta}, context=context)
59
60 amount_untaxed = float_round(amounts['amount_untaxed'] - delta, precision_digits=prec)
61 return {'amount_total': rounded_total,
62 'amount_untaxed': amount_untaxed}
63
64
65 def _l10n_ch_round_globally(self, cr, uid, invoice, amounts, rounded_total, delta, context=None):
66 """Add the diff to the biggest tax line
67
68 This ajustment must be done only after all tax are computed
69 """
70 # Here we identify that all taxe lines have been computed
71 if not _all_invoice_tax_line_computed(invoice):
72 return {}
73
74 obj_precision = self.pool.get('decimal.precision')
75 prec = obj_precision.precision_get(cr, uid, 'Account')
76 inv_tax_obj = self.pool.get('account.invoice.tax')
77
78 ajust_line = None
79 for tax_line in invoice.tax_line:
80 if not ajust_line or tax_line.amount > ajust_line.amount:
81 ajust_line = tax_line
82 if ajust_line:
83 amount = ajust_line.amount - delta
84 vals = inv_tax_obj.amount_change(cr, uid, [ajust_line.id],
85 amount,
86 currency_id=invoice.currency_id.id,
87 company_id=invoice.company_id.id,
88 date_invoice=invoice.date_invoice)['value']
89 ajust_line.write({'amount': amount, 'tax_amount': vals['tax_amount']}, context=context)
90
91 amount_tax = float_round(amounts['amount_tax'] - delta, precision_digits=prec)
92 return {'amount_total': rounded_total,
93 'amount_tax': amount_tax}
94 return {}
95
96
97 def _compute_l10n_rounding(self, cr, uid, invoice, amounts, context=None):
98 """
99 Depending on the method defined, we add an invoice line or adapt the tax lines
100 to have a rounded total amount on the invoice
101
102 :param invoice: invoice browse record
103 :param amounts: unrounded computed totals for the invoice
104 :return dict: updated values for _amount_all
105 """
106
107 obj_precision = self.pool.get('decimal.precision')
108
109 # avoid recusivity
110 if 'l10n_write' in context:
111 return {}
112
113 company = invoice.company_id
114 round_method = company.tax_calculation_rounding_method
115
116 if round_method[:7] != 'l10n_ch':
117 return {}
118
119 prec = obj_precision.precision_get(cr, uid, 'Account')
120 rounding_prec = company.tax_calculation_rounding
121 rounded_total = float_round(amounts['amount_total'], precision_rounding=rounding_prec)
122
123 if float_compare(rounded_total, amounts['amount_total'], precision_digits=prec) == 0:
124 return {}
125
126 # To avoid recursivity as we need to write on invoice or
127 # on objects triggering computation of _amount_all
128 ctx = context.copy()
129 ctx['l10n_write'] = True
130
131 delta = float_round(amounts['amount_total'] - rounded_total, precision_digits=prec)
132
133 if round_method == 'l10n_ch_add_invoice_line':
134 return self._l10n_ch_add_invoice_line(cr, uid, invoice, amounts, rounded_total, delta, context=ctx)
135 elif round_method == 'l10n_ch_round_globally':
136 return self._l10n_ch_round_globally(cr, uid, invoice, amounts, rounded_total, delta, context=ctx)
137 return {}
138
139
140 def _amount_all(self, cr, uid, ids, name, args, context=None):
141 """
142 Add l10n computing and make sure invoice line for rounding is not computed in totals
143 """
144 res = super(AccountInvoice, self)._amount_all(cr, uid, ids, name, args, context=context)
145
146 for invoice in self.browse(cr, uid, ids, context=context):
147 if invoice.type in ('out_invoice','out_refund'):
148 if invoice.global_round_line_id:
149 res[invoice.id]['amount_untaxed'] -= invoice.global_round_line_id.price_subtotal
150
151 amount_total = res[invoice.id]['amount_tax'] + res[invoice.id]['amount_untaxed']
152 res[invoice.id]['amount_total'] = amount_total
153
154 l10n_rounding = self._compute_l10n_rounding(cr, uid, invoice, res[invoice.id], context=context)
155 res[invoice.id].update(l10n_rounding)
156 return res
157
158
159 def _get_rounding_invoice_line_id(self, cr, uid, ids, name, args, context=None):
160 """
161 :return dict: {invoice id: global_rounding_line_id}
162 """
163 line_obj = self.pool.get('account.invoice.line')
164 res = {}
165 for invoice_id in ids:
166 line_ids = line_obj.search(cr, uid,
167 [('invoice_id', '=', invoice_id),
168 ('is_rounding', '=', True)], context=context)
169 res[invoice_id] = line_ids and line_ids[0] or False
170 return res
171
172
173 def _get_invoice_line(self, cr, uid, ids, context=None):
174 """Use super's trigger"""
175 return super(AccountInvoice, self.pool.get('account.invoice'))._get_invoice_line(cr, uid, ids, context=context)
176
177 def _get_invoice_tax(self, cr, uid, ids, context=None):
178 """Use super's trigger"""
179 return super(AccountInvoice, self.pool.get('account.invoice'))._get_invoice_tax(cr, uid, ids, context=context)
180
181 _columns = {
182 'global_round_line_id': fields.function(_get_rounding_invoice_line_id, type='many2one', relation='account.invoice.line', string='Invoice Line for total rounding', readonly=True),
183 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Subtotal', track_visibility='always',
184 store={
185 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
186 'account.invoice.tax': (_get_invoice_tax, None, 20),
187 'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20),
188 },
189 multi='all'),
190 'amount_tax': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Tax',
191 store={
192 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
193 'account.invoice.tax': (_get_invoice_tax, None, 20),
194 'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20),
195 },
196 multi='all'),
197 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Total',
198 store={
199 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
200 'account.invoice.tax': (_get_invoice_tax, None, 20),
201 'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20),
202 },
203 multi='all'),
204 }
205
206
207class AccountInvoiceLine(orm.Model):
208 _inherit = 'account.invoice.line'
209
210 _columns = {
211 'is_rounding': fields.boolean('Rounding Line')
212 }
213
214class AccountTax(orm.Model):
215 _inherit = 'account.tax'
216
217 def compute_inv(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None, precision=None):
218 """
219 Using l10n_ch rounding we want to keep standard global precision
220 so we add precision to do global computation
221 """
222 if taxes and taxes[0].company_id.tax_calculation_rounding_method[:7] == 'l10n_ch':
223 if not precision:
224 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
225 precision += 5
226 return super(AccountTax, self).compute_inv(cr, uid, taxes, price_unit, quantity, product=product, partner=partner, precision=precision)
227
228 def _compute(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None, precision=None):
229 """
230 Using l10n_ch rounding we want to keep standard global precision
231 so we add precision to do global computation
232 """
233 if taxes and taxes[0].company_id.tax_calculation_rounding_method[:7] == 'l10n_ch':
234 if not precision:
235 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
236 precision += 5
237 return super(AccountTax, self)._compute(cr, uid, taxes, price_unit, quantity, product=product, partner=partner, precision=precision)
0238
=== added file 'l10n_ch_invoice_rounding/company.py'
--- l10n_ch_invoice_rounding/company.py 1970-01-01 00:00:00 +0000
+++ l10n_ch_invoice_rounding/company.py 2013-07-16 09:34:25 +0000
@@ -0,0 +1,36 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from openerp.osv import orm, fields
22
23class ResCompany(orm.Model):
24 _inherit = "res.company"
25
26 _columns = {
27 'tax_calculation_rounding': fields.float('Tax Rounding unit'),
28 'tax_calculation_rounding_method': fields.selection([
29 ('round_per_line', 'Round per Line'),
30 ('round_globally', 'Round Globally'),
31 ('l10n_ch_round_globally', 'Swiss Round globally'),
32 ('l10n_ch_add_invoice_line', 'Swiss Round by adding a line'),
33 ], 'Tax Calculation Rounding Method',
34 help="If you select 'Round per Line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax. If you select 'Round Globally': for each tax, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually this total tax amount will be rounded. If you sell with tax included, you should choose 'Round per line' because you certainly want the sum of your tax-included line subtotals to be equal to the total amount with taxes."),
35 'tax_calculation_rounding_account_id': fields.many2one('account.account', 'Tax Rounding Account', domain=[('type', '<>', 'view')]),
36 }
037
=== added directory 'l10n_ch_invoice_rounding/documentation'
=== added file 'l10n_ch_invoice_rounding/documentation/DOC_l10n_ch_5cts_roundings.ods'
1Binary files l10n_ch_invoice_rounding/documentation/DOC_l10n_ch_5cts_roundings.ods 1970-01-01 00:00:00 +0000 and l10n_ch_invoice_rounding/documentation/DOC_l10n_ch_5cts_roundings.ods 2013-07-16 09:34:25 +0000 differ38Binary files l10n_ch_invoice_rounding/documentation/DOC_l10n_ch_5cts_roundings.ods 1970-01-01 00:00:00 +0000 and l10n_ch_invoice_rounding/documentation/DOC_l10n_ch_5cts_roundings.ods 2013-07-16 09:34:25 +0000 differ
=== added file 'l10n_ch_invoice_rounding/res_config.py'
--- l10n_ch_invoice_rounding/res_config.py 1970-01-01 00:00:00 +0000
+++ l10n_ch_invoice_rounding/res_config.py 2013-07-16 09:34:25 +0000
@@ -0,0 +1,49 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from openerp.osv import orm, fields
22
23class AccountConfigSettings(orm.TransientModel):
24 _inherit = 'account.config.settings'
25
26 _columns = {
27 'tax_calculation_rounding_method': fields.related('company_id',
28 'tax_calculation_rounding_method', type='selection', selection=[
29 ('round_per_line', 'Round per line'),
30 ('round_globally', 'Round globally'),
31 ('l10n_ch_round_globally', 'Swiss Round globally'),
32 ('l10n_ch_add_invoice_line', 'Swiss Round by adding an invoice line'),
33 ], string='Tax calculation rounding method',
34 help="If you select 'Round per line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax. If you select 'Round globally': for each tax, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually this total tax amount will be rounded. If you sell with tax included, you should choose 'Round per line' because you certainly want the sum of your tax-included line subtotals to be equal to the total amount with taxes."),
35 'tax_calculation_rounding': fields.related('company_id', 'tax_calculation_rounding', type='float', string='Tax Rounding unit'),
36 'tax_calculation_rounding_account_id': fields.related('company_id', 'tax_calculation_rounding_account_id', type='many2one', relation='account.account', string='Tax Rounding account',
37 domain=[('type', '<>', 'view')]),
38 }
39
40 _defaults = {
41 'tax_calculation_rounding': 0.05
42 }
43
44 def onchange_company_id(self, cr, uid, ids, company_id, context=None):
45 res = super(AccountConfigSettings, self).onchange_company_id(cr, uid, ids, company_id, context=context)
46 company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
47 res['value']['tax_calculation_rounding'] = company.tax_calculation_rounding
48 res['value']['tax_calculation_rounding_account_id'] = company.tax_calculation_rounding_account_id.id
49 return res
050
=== added file 'l10n_ch_invoice_rounding/res_config_view.xml'
--- l10n_ch_invoice_rounding/res_config_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_ch_invoice_rounding/res_config_view.xml 2013-07-16 09:34:25 +0000
@@ -0,0 +1,26 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="view_account_config_settings" model="ir.ui.view">
6 <field name="name">account settings.add.rounding</field>
7 <field name="model">account.config.settings</field>
8 <field name="inherit_id" ref="account.view_account_config_settings"/>
9 <field name="arch" type="xml">
10 <xpath expr="//field[@name='tax_calculation_rounding_method']/ancestor::div[1]" position="after">
11 <div attrs="{'invisible': [('tax_calculation_rounding_method', 'not in', ['l10n_ch_round_globally', 'l10n_ch_add_invoice_line'])]}">
12 <label for="tax_calculation_rounding"/>
13 <field name="tax_calculation_rounding" class="oe_inline"/>
14 </div>
15 <div attrs="{'invisible': [('tax_calculation_rounding_method', '&lt;&gt;', 'l10n_ch_add_invoice_line')]}">
16 <label for="tax_calculation_rounding_account_id"/>
17 <field name="tax_calculation_rounding_account_id"
18 domain="[('type', '&lt;&gt;', 'view')]"
19 attrs="{'required': [('tax_calculation_rounding_method', '=', 'l10n_ch_add_invoice_line')]}" class="oe_inline"/>
20 </div>
21 </xpath>
22 </field>
23 </record>
24
25 </data>
26</openerp>

Subscribers

People subscribed via source and target branches

to all changes: