Merge lp:~openbig/bigconsulting/onchange_to_cal_saleprice into lp:bigconsulting
- onchange_to_cal_saleprice
- Merge into addons
Proposed by
gpa(OpenERP)
Status: | Merged |
---|---|
Merged at revision: | 5 |
Proposed branch: | lp:~openbig/bigconsulting/onchange_to_cal_saleprice |
Merge into: | lp:bigconsulting |
Diff against target: |
1162 lines (+883/-133) 19 files modified
product_price_information/__terp__.py (+1/-1) product_price_information/product_price_info.py (+84/-21) product_price_information/product_price_info_view.xml (+57/-2) product_tax_include/.license (+21/-0) product_tax_include/__init__.py (+28/-1) product_tax_include/__terp__.py (+34/-23) product_tax_include/i18n/ca.po (+78/-0) product_tax_include/i18n/es.po (+79/-0) product_tax_include/i18n/fr.po (+71/-0) product_tax_include/i18n/fr_FR.po (+66/-0) product_tax_include/i18n/product_tax_include.pot (+67/-0) product_tax_include/i18n/pt.po (+77/-0) product_tax_include/object/__init__.py (+27/-0) product_tax_include/object/company.py (+40/-0) product_tax_include/object/product.py (+74/-0) product_tax_include/product.py (+0/-54) product_tax_include/product_view.xml (+0/-31) product_tax_include/view/company.xml (+41/-0) product_tax_include/view/product.xml (+38/-0) |
To merge this branch: | bzr merge lp:~openbig/bigconsulting/onchange_to_cal_saleprice |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
openbig | Pending | ||
Review via email: mp+25664@code.launchpad.net |
Commit message
Description of the change
Added on change to calculate value ofsale price W/o taxes
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 'product_price_information/__terp__.py' |
2 | --- product_price_information/__terp__.py 2010-05-17 14:50:10 +0000 |
3 | +++ product_price_information/__terp__.py 2010-05-20 07:24:29 +0000 |
4 | @@ -29,7 +29,7 @@ |
5 | and product view called from sale order line. Shop Price will display product price |
6 | based on pricelist defined in shop selected in sale order. |
7 | """, |
8 | - "depends": ['sale'], |
9 | + "depends": ['sale','product_tax_include','sale_tax_include'], |
10 | "demo_xml": [], |
11 | "update_xml": ['product_price_info_view.xml' ], |
12 | "license": "GPL-3", |
13 | |
14 | === modified file 'product_price_information/product_price_info.py' |
15 | --- product_price_information/product_price_info.py 2010-05-17 14:50:10 +0000 |
16 | +++ product_price_information/product_price_info.py 2010-05-20 07:24:29 +0000 |
17 | @@ -56,25 +56,88 @@ |
18 | class sale_order_line(osv.osv): |
19 | _inherit = "sale.order.line" |
20 | |
21 | - def _compute_shop_price(self, cr, uid, ids, name, arg, context=None): |
22 | - if not context: |
23 | - context = {} |
24 | - res = {} |
25 | - pricelist_obj = self.pool.get('product.pricelist') |
26 | - for so_line in self.browse(cr, uid, ids): |
27 | - sale_order_id = so_line.order_id |
28 | - shop_id = sale_order_id.shop_id |
29 | - if shop_id.pricelist_id: |
30 | - pricelist_id = shop_id.pricelist_id.id |
31 | - price_unit = pricelist_obj.price_get(cr, uid, [pricelist_id], so_line.product_id.id, so_line.product_uom_qty or 1.0, sale_order_id.partner_id, {'uom': so_line.product_uom.id})[pricelist_id] |
32 | - else: |
33 | - pricelist_id = sale_order_id.pricelist_id.id |
34 | - price_unit = pricelist_obj.price_get(cr, uid, [pricelist_id], so_line.product_id.id, so_line.product_uom_qty or 1.0, sale_order_id.partner_id, {'uom': so_line.product_uom.id})[pricelist_id] |
35 | - res[so_line.id] = price_unit |
36 | + _columns = { |
37 | + 'sale_price_unit_tax': fields.float('Sale price W/O taxes'), |
38 | + } |
39 | + |
40 | + def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, |
41 | + uom=False, qty_uos=0, uos=False, name='', partner_id=False, |
42 | + lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): |
43 | + |
44 | + tax_obj = self.pool.get('account.tax') |
45 | + |
46 | + result = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, |
47 | + uom, qty_uos, uos, name, partner_id, lang, update_tax, date_order, packaging, fiscal_position, flag) |
48 | + if product: |
49 | + context = {'lang': lang, 'partner_id': partner_id, 'qty': qty} |
50 | + product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context) |
51 | + result['value']['sale_price_unit_tax'] = product_obj.product_tmpl_id.price_unit_tax |
52 | + |
53 | + return result |
54 | + |
55 | +sale_order_line() |
56 | + |
57 | +class sale_order(osv.osv): |
58 | + _name = "sale.order" |
59 | + _inherit = "sale.order" |
60 | + |
61 | + def onchange_shop_id(self, cr, uid, ids, shop_id): |
62 | + res = super(sale_order, self).onchange_shop_id(cr, uid, id, shop_id) |
63 | + if 'value' in res and shop_id: |
64 | + res['value']['price_type'] = self.pool.get('sale.shop').browse(cr, uid , shop_id).price_type |
65 | return res |
66 | - |
67 | - _columns = { |
68 | - 'shop_price': fields.function(_compute_shop_price, method=True, type='float', string='Shop Price', digits=(16, int(config['price_accuracy']))), |
69 | - } |
70 | - |
71 | -sale_order_line() |
72 | \ No newline at end of file |
73 | + |
74 | +sale_order() |
75 | + |
76 | + |
77 | +class sale_shop(osv.osv): |
78 | + _name = 'sale.shop' |
79 | + _inherit = 'sale.shop' |
80 | + _columns = { |
81 | + 'price_type': fields.selection([ |
82 | + ('tax_included','Tax included'), |
83 | + ('tax_excluded','Tax excluded') |
84 | + ], 'Price method', required=True), |
85 | + } |
86 | + _defaults = { |
87 | + 'price_type': lambda *a: 'tax_included', |
88 | + } |
89 | + |
90 | +sale_shop() |
91 | + |
92 | +class sale_shop_price_method_policy(osv.osv_memory): |
93 | + _name = 'sale.shop.price.method' |
94 | + _columns = { |
95 | + 'name': fields.char('Name', size=64), |
96 | + 'price_type': fields.selection([ |
97 | + ('tax_included','Tax included'), |
98 | + ('tax_excluded','Tax excluded') |
99 | + ], 'Price method', required=True), |
100 | + } |
101 | + _defaults = { |
102 | + 'price_type': lambda *a: 'tax_included', |
103 | + } |
104 | + |
105 | + def set_default(self, cr, uid, ids, context=None): |
106 | + for o in self.browse(cr, uid, ids, context=context): |
107 | + ir_values_obj = self.pool.get('ir.values') |
108 | + print "o.price_type",o.price_type |
109 | + ir_values_obj.set(cr, uid, 'default', False, 'price_type', ['sale.shop'], o.price_type) |
110 | + return { |
111 | + 'view_type': 'form', |
112 | + "view_mode": 'form', |
113 | + 'res_model': 'ir.actions.configuration.wizard', |
114 | + 'type': 'ir.actions.act_window', |
115 | + 'target': 'new', |
116 | + } |
117 | + |
118 | + def action_cancel(self,cr,uid,ids,conect=None): |
119 | + return { |
120 | + 'view_type': 'form', |
121 | + "view_mode": 'form', |
122 | + 'res_model': 'ir.actions.configuration.wizard', |
123 | + 'type': 'ir.actions.act_window', |
124 | + 'target':'new', |
125 | + } |
126 | + |
127 | +sale_shop_price_method_policy() |
128 | \ No newline at end of file |
129 | |
130 | === modified file 'product_price_information/product_price_info_view.xml' |
131 | --- product_price_information/product_price_info_view.xml 2010-05-17 14:50:10 +0000 |
132 | +++ product_price_information/product_price_info_view.xml 2010-05-20 07:24:29 +0000 |
133 | @@ -43,7 +43,8 @@ |
134 | </xpath> |
135 | </field> |
136 | </record> |
137 | - |
138 | + |
139 | + |
140 | <!-- Adding shop price field on sale order line form below Unit Price --> |
141 | |
142 | <record model="ir.ui.view" id="view_sale_order_line_tree_direct_delivery"> |
143 | @@ -53,10 +54,64 @@ |
144 | <field name="type">form</field> |
145 | <field name="arch" type="xml"> |
146 | <xpath expr="//field[@name='discount']" position="after"> |
147 | - <field name="shop_price"/> |
148 | + <field name="sale_price_unit_tax"/> |
149 | </xpath> |
150 | </field> |
151 | </record> |
152 | + |
153 | + <record model="ir.ui.view" id="product_tax_include_tree"> |
154 | + <field name="name">product.tax.include.tree</field> |
155 | + <field name="model">product.product</field> |
156 | + <field name="type">form</field> |
157 | + <field name="inherit_id" ref="product.product_product_tree_view"/> |
158 | + <field name="arch" type="xml"> |
159 | + <field name="lst_price" position="before"> |
160 | + <field name="price_unit_tax"/> |
161 | + </field> |
162 | + </field> |
163 | + </record> |
164 | + |
165 | + <record id="view_partner_property_form" model="ir.ui.view"> |
166 | + <field name="name">sale.shop.property.form.inherit</field> |
167 | + <field name="model">sale.shop</field> |
168 | + <field name="type">form</field> |
169 | + <field name="inherit_id" ref="sale.view_shop_form"/> |
170 | + <field name="arch" type="xml"> |
171 | + <field name="project_id" position="after"> |
172 | + <field name="price_type"/> |
173 | + </field> |
174 | + </field> |
175 | + </record> |
176 | + |
177 | + <record id="view_config_price_policy" model="ir.ui.view"> |
178 | + <field name="name">Price Method for Sale Order Shop</field> |
179 | + <field name="model">sale.shop.price.method</field> |
180 | + <field name="type">form</field> |
181 | + <field name="arch" type="xml"> |
182 | + <form string="Shop Configuration"> |
183 | + <field name="price_type"/> |
184 | + <newline/> |
185 | + <group col="4" colspan="4"> |
186 | + <button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/> |
187 | + <button icon="gtk-ok" name="set_default" string="Set Default" type="object"/> |
188 | + </group> |
189 | + </form> |
190 | + </field> |
191 | + </record> |
192 | + |
193 | + <record id="action_config_price_policy" model="ir.actions.act_window"> |
194 | + <field name="name">Price Method for Sale Order Shop</field> |
195 | + <field name="type">ir.actions.act_window</field> |
196 | + <field name="res_model">sale.shop.price.method</field> |
197 | + <field name="view_type">form</field> |
198 | + <field name="view_mode">form</field> |
199 | + <field name="target">new</field> |
200 | + </record> |
201 | + |
202 | + <record id="config_wizard_step_shop_price_policy" model="ir.actions.todo"> |
203 | + <field name="name">Shop Price</field> |
204 | + <field name="action_id" ref="action_config_price_policy"/> |
205 | + </record> |
206 | |
207 | </data> |
208 | </openerp> |
209 | |
210 | === added file 'product_tax_include/.license' |
211 | --- product_tax_include/.license 1970-01-01 00:00:00 +0000 |
212 | +++ product_tax_include/.license 2010-05-20 07:24:29 +0000 |
213 | @@ -0,0 +1,21 @@ |
214 | +############################################################################## |
215 | +# |
216 | +# product_tax_include module for OpenERP, Add new field for tax include in product |
217 | +# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE |
218 | +# |
219 | +# This file is a part of product_tax_include |
220 | +# |
221 | +# product_tax_include is free software: you can redistribute it and/or modify |
222 | +# it under the terms of the GNU General Public License as published by |
223 | +# the Free Software Foundation, either version 3 of the License, or |
224 | +# (at your option) any later version. |
225 | +# |
226 | +# product_tax_include is distributed in the hope that it will be useful, |
227 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
228 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
229 | +# GNU General Public License for more details. |
230 | +# |
231 | +# You should have received a copy of the GNU General Public License |
232 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
233 | +# |
234 | +############################################################################## |
235 | |
236 | === modified file 'product_tax_include/__init__.py' (properties changed: +x to -x) |
237 | --- product_tax_include/__init__.py 2010-05-19 08:34:42 +0000 |
238 | +++ product_tax_include/__init__.py 2010-05-20 07:24:29 +0000 |
239 | @@ -1,1 +1,28 @@ |
240 | -import product |
241 | \ No newline at end of file |
242 | +# -*- coding: utf-8 -*- |
243 | +############################################################################## |
244 | +# |
245 | +# product_tax_include module for OpenERP, Add new field for tax include in product |
246 | +# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE |
247 | +# |
248 | +# This file is a part of product_tax_include |
249 | +# |
250 | +# product_tax_include is free software: you can redistribute it and/or modify |
251 | +# it under the terms of the GNU General Public License as published by |
252 | +# the Free Software Foundation, either version 3 of the License, or |
253 | +# (at your option) any later version. |
254 | +# |
255 | +# product_tax_include is distributed in the hope that it will be useful, |
256 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
257 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
258 | +# GNU General Public License for more details. |
259 | +# |
260 | +# You should have received a copy of the GNU General Public License |
261 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
262 | +# |
263 | +############################################################################## |
264 | + |
265 | +import object |
266 | +import report |
267 | +import wizard |
268 | + |
269 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
270 | \ No newline at end of file |
271 | |
272 | === modified file 'product_tax_include/__terp__.py' (properties changed: +x to -x) |
273 | --- product_tax_include/__terp__.py 2010-05-19 08:34:42 +0000 |
274 | +++ product_tax_include/__terp__.py 2010-05-20 07:24:29 +0000 |
275 | @@ -1,16 +1,17 @@ |
276 | -# -*- encoding: utf-8 -*- |
277 | +# -*- coding: utf-8 -*- |
278 | ############################################################################## |
279 | # |
280 | -# OpenERP, Open Source Management Solution |
281 | -# Copyright (C) 2009 Smile.fr. All Rights Reserved |
282 | -# author: Raphaël Valyi, Amadou Diallo |
283 | -# |
284 | -# This program is free software: you can redistribute it and/or modify |
285 | +# product_tax_include module for OpenERP, Add new field for tax include in product |
286 | +# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE |
287 | +# |
288 | +# This file is a part of product_tax_include |
289 | +# |
290 | +# product_tax_include is free software: you can redistribute it and/or modify |
291 | # it under the terms of the GNU General Public License as published by |
292 | # the Free Software Foundation, either version 3 of the License, or |
293 | # (at your option) any later version. |
294 | # |
295 | -# This program is distributed in the hope that it will be useful, |
296 | +# product_tax_include is distributed in the hope that it will be useful, |
297 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
298 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
299 | # GNU General Public License for more details. |
300 | @@ -19,22 +20,32 @@ |
301 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
302 | # |
303 | ############################################################################## |
304 | + |
305 | { |
306 | - "name" : "Product Tax Include", |
307 | - "description":"""Product Tax Include |
308 | -Allows to compute the base sale untaxed amount given a taxed amount entry (change the list_price on on_change) |
309 | -and reciprocally. |
310 | - """, |
311 | - "version" : "0.1", |
312 | - "author" : "Smile.fr", |
313 | - "category" : "Custom", |
314 | - "depends" : ["product", "account"], |
315 | - "init_xml" : [], |
316 | - "demo_xml" : [], |
317 | - "update_xml" : ["product_view.xml"], |
318 | - "active": False, |
319 | - "installable": True |
320 | + 'name': 'Product Tax Include', |
321 | + 'version': '0.0.1', |
322 | + 'category': 'Generic Modules/Inventory Control', |
323 | + 'description': """Add new field for tax include in product |
324 | + |
325 | + OpenERP version : 5.0 |
326 | + Creation : 2009-12-05 |
327 | + Last update : 2009-12-05 |
328 | +""", |
329 | + 'author': 'SYLEAM Info Services', |
330 | + 'depends': [ |
331 | + "base", |
332 | + "product", |
333 | + "account_tax_include", |
334 | + ], |
335 | + 'init_xml': [], |
336 | + 'update_xml': [ |
337 | + "view/company.xml", |
338 | + "view/product.xml", |
339 | + ], |
340 | + 'demo_xml': [], |
341 | + 'installable': True, |
342 | + 'active': False, |
343 | + 'license': 'GPL-3', |
344 | } |
345 | + |
346 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
347 | - |
348 | -#,"product_variant_configurator_wizard.xml" |
349 | \ No newline at end of file |
350 | |
351 | === added directory 'product_tax_include/i18n' |
352 | === added file 'product_tax_include/i18n/ca.po' |
353 | --- product_tax_include/i18n/ca.po 1970-01-01 00:00:00 +0000 |
354 | +++ product_tax_include/i18n/ca.po 2010-05-20 07:24:29 +0000 |
355 | @@ -0,0 +1,78 @@ |
356 | +# Catalan translation for openobject-addons |
357 | +# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 |
358 | +# This file is distributed under the same license as the openobject-addons package. |
359 | +# FIRST AUTHOR <EMAIL@ADDRESS>, 2009. |
360 | +# |
361 | +msgid "" |
362 | +msgstr "" |
363 | +"Project-Id-Version: openobject-addons\n" |
364 | +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" |
365 | +"POT-Creation-Date: 2009-12-05 14:38+0000\n" |
366 | +"PO-Revision-Date: 2009-12-07 06:02+0000\n" |
367 | +"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " |
368 | +"<jesteve@zikzakmedia.com>\n" |
369 | +"Language-Team: Catalan <ca@li.org>\n" |
370 | +"MIME-Version: 1.0\n" |
371 | +"Content-Type: text/plain; charset=UTF-8\n" |
372 | +"Content-Transfer-Encoding: 8bit\n" |
373 | +"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n" |
374 | +"X-Generator: Launchpad (build Unknown)\n" |
375 | + |
376 | +#. module: product_tax_include |
377 | +#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information |
378 | +msgid "Product Tax Include" |
379 | +msgstr "Productes amb impostos inclosos" |
380 | + |
381 | +#. module: product_tax_include |
382 | +#: constraint:ir.ui.view:0 |
383 | +msgid "Invalid XML for View Architecture!" |
384 | +msgstr "XML invàlid per a la definició de la vista!" |
385 | + |
386 | +#. module: product_tax_include |
387 | +#: help:product.template,price_unit_tax:0 |
388 | +msgid "" |
389 | +"Price calculated with taxes included or excluded, depend of the " |
390 | +"configuration in company configuration" |
391 | +msgstr "" |
392 | +"Preu calculat amb impostos inclosos o exclosos, depenent de la configuració " |
393 | +"de la companyia." |
394 | + |
395 | +#. module: product_tax_include |
396 | +#: view:res.company:0 |
397 | +msgid "Product" |
398 | +msgstr "Producte" |
399 | + |
400 | +#. module: product_tax_include |
401 | +#: field:product.template,price_unit_tax:0 |
402 | +msgid "Sale price with taxes included or excluded" |
403 | +msgstr "Preu de venda amb impostos inclosos o exclosos" |
404 | + |
405 | +#. module: product_tax_include |
406 | +#: field:res.company,product_prices_tax_include:0 |
407 | +msgid "Prices tax included" |
408 | +msgstr "Preus impostos inclosos" |
409 | + |
410 | +#. module: product_tax_include |
411 | +#: help:res.company,product_prices_tax_include:0 |
412 | +msgid "Product prices have tax included." |
413 | +msgstr "Els preus del producte tenen els impostos inclosos." |
414 | + |
415 | +#. module: product_tax_include |
416 | +#: view:res.company:0 |
417 | +msgid "Configuration" |
418 | +msgstr "Configuració" |
419 | + |
420 | +#. module: product_tax_include |
421 | +#: model:ir.module.module,description:product_tax_include.module_meta_information |
422 | +msgid "" |
423 | +"Add new field for tax include in product\n" |
424 | +"\n" |
425 | +" OpenERP version : 5.0\n" |
426 | +" Creation : 2009-12-05\n" |
427 | +" Last update : 2009-12-05\n" |
428 | +msgstr "" |
429 | +"Afegeix un nou camp per als impostos inclosos en els preus del producte\n" |
430 | +"\n" |
431 | +" OpenERP versió : 5.0\n" |
432 | +" Creació : 05-12-2009\n" |
433 | +" Última actualització : 05-12-2009\n" |
434 | |
435 | === added file 'product_tax_include/i18n/es.po' |
436 | --- product_tax_include/i18n/es.po 1970-01-01 00:00:00 +0000 |
437 | +++ product_tax_include/i18n/es.po 2010-05-20 07:24:29 +0000 |
438 | @@ -0,0 +1,79 @@ |
439 | +# Spanish translation for openobject-addons |
440 | +# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 |
441 | +# This file is distributed under the same license as the openobject-addons package. |
442 | +# FIRST AUTHOR <EMAIL@ADDRESS>, 2009. |
443 | +# |
444 | +msgid "" |
445 | +msgstr "" |
446 | +"Project-Id-Version: openobject-addons\n" |
447 | +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" |
448 | +"POT-Creation-Date: 2009-12-05 14:38+0000\n" |
449 | +"PO-Revision-Date: 2009-12-06 06:03+0000\n" |
450 | +"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " |
451 | +"<jesteve@zikzakmedia.com>\n" |
452 | +"Language-Team: Spanish <es@li.org>\n" |
453 | +"MIME-Version: 1.0\n" |
454 | +"Content-Type: text/plain; charset=UTF-8\n" |
455 | +"Content-Transfer-Encoding: 8bit\n" |
456 | +"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n" |
457 | +"X-Generator: Launchpad (build Unknown)\n" |
458 | + |
459 | +#. module: product_tax_include |
460 | +#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information |
461 | +msgid "Product Tax Include" |
462 | +msgstr "Productos con impuestos incluidos" |
463 | + |
464 | +#. module: product_tax_include |
465 | +#: constraint:ir.ui.view:0 |
466 | +msgid "Invalid XML for View Architecture!" |
467 | +msgstr "¡XML inválido para la definición de la vista!" |
468 | + |
469 | +#. module: product_tax_include |
470 | +#: help:product.template,price_unit_tax:0 |
471 | +msgid "" |
472 | +"Price calculated with taxes included or excluded, depend of the " |
473 | +"configuration in company configuration" |
474 | +msgstr "" |
475 | +"Precio calculado con impuestos incluidos o excluidos, dependiendo de la " |
476 | +"configuración de la compañía." |
477 | + |
478 | +#. module: product_tax_include |
479 | +#: view:res.company:0 |
480 | +msgid "Product" |
481 | +msgstr "Producto" |
482 | + |
483 | +#. module: product_tax_include |
484 | +#: field:product.template,price_unit_tax:0 |
485 | +msgid "Sale price with taxes included or excluded" |
486 | +msgstr "Precio de venta con impuestos incluidos o excluidos" |
487 | + |
488 | +#. module: product_tax_include |
489 | +#: field:res.company,product_prices_tax_include:0 |
490 | +msgid "Prices tax included" |
491 | +msgstr "Precios impuestos incluidos" |
492 | + |
493 | +#. module: product_tax_include |
494 | +#: help:res.company,product_prices_tax_include:0 |
495 | +msgid "Product prices have tax included." |
496 | +msgstr "Los precios del producto tienen los impuestos incluidos." |
497 | + |
498 | +#. module: product_tax_include |
499 | +#: view:res.company:0 |
500 | +msgid "Configuration" |
501 | +msgstr "Configuración" |
502 | + |
503 | +#. module: product_tax_include |
504 | +#: model:ir.module.module,description:product_tax_include.module_meta_information |
505 | +msgid "" |
506 | +"Add new field for tax include in product\n" |
507 | +"\n" |
508 | +" OpenERP version : 5.0\n" |
509 | +" Creation : 2009-12-05\n" |
510 | +" Last update : 2009-12-05\n" |
511 | +msgstr "" |
512 | +"Añade un nuevo campo para los impuestos incluidos en los precios del " |
513 | +"producto\n" |
514 | +"\n" |
515 | +" OpenERP versión : 5.0\n" |
516 | +" Creación : 05-12-2009\n" |
517 | +" Última actualización : 05-12-2009\n" |
518 | |
519 | === added file 'product_tax_include/i18n/fr.po' |
520 | --- product_tax_include/i18n/fr.po 1970-01-01 00:00:00 +0000 |
521 | +++ product_tax_include/i18n/fr.po 2010-05-20 07:24:29 +0000 |
522 | @@ -0,0 +1,71 @@ |
523 | +# Translation of OpenERP Server. |
524 | +# This file contains the translation of the following modules: |
525 | +# * product_tax_include |
526 | +# |
527 | +msgid "" |
528 | +msgstr "" |
529 | +"Project-Id-Version: OpenERP Server 5.0.6\n" |
530 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
531 | +"POT-Creation-Date: 2009-12-05 14:38+0000\n" |
532 | +"PO-Revision-Date: 2009-12-05 16:27+0000\n" |
533 | +"Last-Translator: Sebastien LANGE - http://www.Syleam.fr <Unknown>\n" |
534 | +"Language-Team: \n" |
535 | +"MIME-Version: 1.0\n" |
536 | +"Content-Type: text/plain; charset=UTF-8\n" |
537 | +"Content-Transfer-Encoding: 8bit\n" |
538 | +"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n" |
539 | +"X-Generator: Launchpad (build Unknown)\n" |
540 | + |
541 | +#. module: product_tax_include |
542 | +#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information |
543 | +msgid "Product Tax Include" |
544 | +msgstr "" |
545 | + |
546 | +#. module: product_tax_include |
547 | +#: constraint:ir.ui.view:0 |
548 | +msgid "Invalid XML for View Architecture!" |
549 | +msgstr "Formulaire XML invalide pour ce type de vue" |
550 | + |
551 | +#. module: product_tax_include |
552 | +#: help:product.template,price_unit_tax:0 |
553 | +msgid "" |
554 | +"Price calculated with taxes included or excluded, depend of the " |
555 | +"configuration in company configuration" |
556 | +msgstr "" |
557 | +"Prix calculé avec taxes incluses ou excluses, dépend du paramétrage dans la " |
558 | +"société" |
559 | + |
560 | +#. module: product_tax_include |
561 | +#: view:res.company:0 |
562 | +msgid "Product" |
563 | +msgstr "Produit" |
564 | + |
565 | +#. module: product_tax_include |
566 | +#: field:product.template,price_unit_tax:0 |
567 | +msgid "Sale price with taxes included or excluded" |
568 | +msgstr "Prix de vente avec taxes incluses ou excluses" |
569 | + |
570 | +#. module: product_tax_include |
571 | +#: field:res.company,product_prices_tax_include:0 |
572 | +msgid "Prices tax included" |
573 | +msgstr "Taxes incluses dans le prix" |
574 | + |
575 | +#. module: product_tax_include |
576 | +#: help:res.company,product_prices_tax_include:0 |
577 | +msgid "Product prices have tax included." |
578 | +msgstr "Taxes incluses dans le prix du produit" |
579 | + |
580 | +#. module: product_tax_include |
581 | +#: view:res.company:0 |
582 | +msgid "Configuration" |
583 | +msgstr "Configuration" |
584 | + |
585 | +#. module: product_tax_include |
586 | +#: model:ir.module.module,description:product_tax_include.module_meta_information |
587 | +msgid "" |
588 | +"Add new field for tax include in product\n" |
589 | +"\n" |
590 | +" OpenERP version : 5.0\n" |
591 | +" Creation : 2009-12-05\n" |
592 | +" Last update : 2009-12-05\n" |
593 | +msgstr "" |
594 | |
595 | === added file 'product_tax_include/i18n/fr_FR.po' |
596 | --- product_tax_include/i18n/fr_FR.po 1970-01-01 00:00:00 +0000 |
597 | +++ product_tax_include/i18n/fr_FR.po 2010-05-20 07:24:29 +0000 |
598 | @@ -0,0 +1,66 @@ |
599 | +# Translation of OpenERP Server. |
600 | +# This file contains the translation of the following modules: |
601 | +# * product_tax_include |
602 | +# |
603 | +msgid "" |
604 | +msgstr "" |
605 | +"Project-Id-Version: OpenERP Server 5.0.6\n" |
606 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
607 | +"POT-Creation-Date: 2009-12-05 14:39:03+0000\n" |
608 | +"PO-Revision-Date: 2009-12-05 14:39:03+0000\n" |
609 | +"Last-Translator: <>\n" |
610 | +"Language-Team: \n" |
611 | +"MIME-Version: 1.0\n" |
612 | +"Content-Type: text/plain; charset=UTF-8\n" |
613 | +"Content-Transfer-Encoding: \n" |
614 | +"Plural-Forms: \n" |
615 | + |
616 | +#. module: product_tax_include |
617 | +#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information |
618 | +msgid "Product Tax Include" |
619 | +msgstr "" |
620 | + |
621 | +#. module: product_tax_include |
622 | +#: constraint:ir.ui.view:0 |
623 | +msgid "Invalid XML for View Architecture!" |
624 | +msgstr "Formulaire XML invalide pour ce type de vue" |
625 | + |
626 | +#. module: product_tax_include |
627 | +#: help:product.template,price_unit_tax:0 |
628 | +msgid "Price calculated with taxes included or excluded, depend of the configuration in company configuration" |
629 | +msgstr "Prix calculé avec taxes incluses ou excluses, dépend du paramétrage dans la société" |
630 | + |
631 | +#. module: product_tax_include |
632 | +#: view:res.company:0 |
633 | +msgid "Product" |
634 | +msgstr "Produit" |
635 | + |
636 | +#. module: product_tax_include |
637 | +#: field:product.template,price_unit_tax:0 |
638 | +msgid "Sale price with taxes included or excluded" |
639 | +msgstr "Prix de vente avec taxes incluses ou excluses" |
640 | + |
641 | +#. module: product_tax_include |
642 | +#: field:res.company,product_prices_tax_include:0 |
643 | +msgid "Prices tax included" |
644 | +msgstr "Taxes incluses dans le prix" |
645 | + |
646 | +#. module: product_tax_include |
647 | +#: help:res.company,product_prices_tax_include:0 |
648 | +msgid "Product prices have tax included." |
649 | +msgstr "Taxes incluses dans le prix du produit" |
650 | + |
651 | +#. module: product_tax_include |
652 | +#: view:res.company:0 |
653 | +msgid "Configuration" |
654 | +msgstr "Configuration" |
655 | + |
656 | +#. module: product_tax_include |
657 | +#: model:ir.module.module,description:product_tax_include.module_meta_information |
658 | +msgid "Add new field for tax include in product\n" |
659 | +"\n" |
660 | +" OpenERP version : 5.0\n" |
661 | +" Creation : 2009-12-05\n" |
662 | +" Last update : 2009-12-05\n" |
663 | +"" |
664 | +msgstr "" |
665 | |
666 | === added file 'product_tax_include/i18n/product_tax_include.pot' |
667 | --- product_tax_include/i18n/product_tax_include.pot 1970-01-01 00:00:00 +0000 |
668 | +++ product_tax_include/i18n/product_tax_include.pot 2010-05-20 07:24:29 +0000 |
669 | @@ -0,0 +1,67 @@ |
670 | +# Translation of OpenERP Server. |
671 | +# This file contains the translation of the following modules: |
672 | +# * product_tax_include |
673 | +# |
674 | +msgid "" |
675 | +msgstr "" |
676 | +"Project-Id-Version: OpenERP Server 5.0.6\n" |
677 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
678 | +"POT-Creation-Date: 2009-12-05 14:38:47+0000\n" |
679 | +"PO-Revision-Date: 2009-12-05 14:38:47+0000\n" |
680 | +"Last-Translator: <>\n" |
681 | +"Language-Team: \n" |
682 | +"MIME-Version: 1.0\n" |
683 | +"Content-Type: text/plain; charset=UTF-8\n" |
684 | +"Content-Transfer-Encoding: \n" |
685 | +"Plural-Forms: \n" |
686 | + |
687 | +#. module: product_tax_include |
688 | +#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information |
689 | +msgid "Product Tax Include" |
690 | +msgstr "" |
691 | + |
692 | +#. module: product_tax_include |
693 | +#: constraint:ir.ui.view:0 |
694 | +msgid "Invalid XML for View Architecture!" |
695 | +msgstr "" |
696 | + |
697 | +#. module: product_tax_include |
698 | +#: help:product.template,price_unit_tax:0 |
699 | +msgid "Price calculated with taxes included or excluded, depend of the configuration in company configuration" |
700 | +msgstr "" |
701 | + |
702 | +#. module: product_tax_include |
703 | +#: view:res.company:0 |
704 | +msgid "Product" |
705 | +msgstr "" |
706 | + |
707 | +#. module: product_tax_include |
708 | +#: field:product.template,price_unit_tax:0 |
709 | +msgid "Sale price with taxes included or excluded" |
710 | +msgstr "" |
711 | + |
712 | +#. module: product_tax_include |
713 | +#: field:res.company,product_prices_tax_include:0 |
714 | +msgid "Prices tax included" |
715 | +msgstr "" |
716 | + |
717 | +#. module: product_tax_include |
718 | +#: help:res.company,product_prices_tax_include:0 |
719 | +msgid "Product prices have tax included." |
720 | +msgstr "" |
721 | + |
722 | +#. module: product_tax_include |
723 | +#: view:res.company:0 |
724 | +msgid "Configuration" |
725 | +msgstr "" |
726 | + |
727 | +#. module: product_tax_include |
728 | +#: model:ir.module.module,description:product_tax_include.module_meta_information |
729 | +msgid "Add new field for tax include in product\n" |
730 | +"\n" |
731 | +" OpenERP version : 5.0\n" |
732 | +" Creation : 2009-12-05\n" |
733 | +" Last update : 2009-12-05\n" |
734 | +"" |
735 | +msgstr "" |
736 | + |
737 | |
738 | === added file 'product_tax_include/i18n/pt.po' |
739 | --- product_tax_include/i18n/pt.po 1970-01-01 00:00:00 +0000 |
740 | +++ product_tax_include/i18n/pt.po 2010-05-20 07:24:29 +0000 |
741 | @@ -0,0 +1,77 @@ |
742 | +# Portuguese translation for openobject-addons |
743 | +# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 |
744 | +# This file is distributed under the same license as the openobject-addons package. |
745 | +# FIRST AUTHOR <EMAIL@ADDRESS>, 2009. |
746 | +# |
747 | +msgid "" |
748 | +msgstr "" |
749 | +"Project-Id-Version: openobject-addons\n" |
750 | +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" |
751 | +"POT-Creation-Date: 2009-12-05 14:38+0000\n" |
752 | +"PO-Revision-Date: 2009-12-10 06:00+0000\n" |
753 | +"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n" |
754 | +"Language-Team: Portuguese <pt@li.org>\n" |
755 | +"MIME-Version: 1.0\n" |
756 | +"Content-Type: text/plain; charset=UTF-8\n" |
757 | +"Content-Transfer-Encoding: 8bit\n" |
758 | +"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n" |
759 | +"X-Generator: Launchpad (build Unknown)\n" |
760 | + |
761 | +#. module: product_tax_include |
762 | +#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information |
763 | +msgid "Product Tax Include" |
764 | +msgstr "Artigos Imposto incluido" |
765 | + |
766 | +#. module: product_tax_include |
767 | +#: constraint:ir.ui.view:0 |
768 | +msgid "Invalid XML for View Architecture!" |
769 | +msgstr "XML inválido para a arquitectura da vista" |
770 | + |
771 | +#. module: product_tax_include |
772 | +#: help:product.template,price_unit_tax:0 |
773 | +msgid "" |
774 | +"Price calculated with taxes included or excluded, depend of the " |
775 | +"configuration in company configuration" |
776 | +msgstr "" |
777 | +"Preço calculado com impostos incluídos ou excluídos, dependendo da " |
778 | +"configuração da companhia." |
779 | + |
780 | +#. module: product_tax_include |
781 | +#: view:res.company:0 |
782 | +msgid "Product" |
783 | +msgstr "Artigo" |
784 | + |
785 | +#. module: product_tax_include |
786 | +#: field:product.template,price_unit_tax:0 |
787 | +msgid "Sale price with taxes included or excluded" |
788 | +msgstr "Preço de venda com impostos incluídos ou excluídos" |
789 | + |
790 | +#. module: product_tax_include |
791 | +#: field:res.company,product_prices_tax_include:0 |
792 | +msgid "Prices tax included" |
793 | +msgstr "Preço com impostos incluídos" |
794 | + |
795 | +#. module: product_tax_include |
796 | +#: help:res.company,product_prices_tax_include:0 |
797 | +msgid "Product prices have tax included." |
798 | +msgstr "Os preços dos artigos têm imposto incluído." |
799 | + |
800 | +#. module: product_tax_include |
801 | +#: view:res.company:0 |
802 | +msgid "Configuration" |
803 | +msgstr "Configuração" |
804 | + |
805 | +#. module: product_tax_include |
806 | +#: model:ir.module.module,description:product_tax_include.module_meta_information |
807 | +msgid "" |
808 | +"Add new field for tax include in product\n" |
809 | +"\n" |
810 | +" OpenERP version : 5.0\n" |
811 | +" Creation : 2009-12-05\n" |
812 | +" Last update : 2009-12-05\n" |
813 | +msgstr "" |
814 | +"Adiciona um novo campoem artigos para impostos incluídos\n" |
815 | +"\n" |
816 | +" OpenERP versão : 5.0\n" |
817 | +" Criação : 2009-12-05\n" |
818 | +" Última actualização : 2009-12-05\n" |
819 | |
820 | === added directory 'product_tax_include/object' |
821 | === added file 'product_tax_include/object/__init__.py' |
822 | --- product_tax_include/object/__init__.py 1970-01-01 00:00:00 +0000 |
823 | +++ product_tax_include/object/__init__.py 2010-05-20 07:24:29 +0000 |
824 | @@ -0,0 +1,27 @@ |
825 | +# -*- coding: utf-8 -*- |
826 | +############################################################################## |
827 | +# |
828 | +# product_tax_include module for OpenERP, Add new field for tax include in product |
829 | +# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE |
830 | +# |
831 | +# This file is a part of product_tax_include |
832 | +# |
833 | +# product_tax_include is free software: you can redistribute it and/or modify |
834 | +# it under the terms of the GNU General Public License as published by |
835 | +# the Free Software Foundation, either version 3 of the License, or |
836 | +# (at your option) any later version. |
837 | +# |
838 | +# product_tax_include is distributed in the hope that it will be useful, |
839 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
840 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
841 | +# GNU General Public License for more details. |
842 | +# |
843 | +# You should have received a copy of the GNU General Public License |
844 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
845 | +# |
846 | +############################################################################## |
847 | + |
848 | +import product |
849 | +import company |
850 | + |
851 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
852 | |
853 | === added file 'product_tax_include/object/company.py' |
854 | --- product_tax_include/object/company.py 1970-01-01 00:00:00 +0000 |
855 | +++ product_tax_include/object/company.py 2010-05-20 07:24:29 +0000 |
856 | @@ -0,0 +1,40 @@ |
857 | +# -*- coding: utf-8 -*- |
858 | +############################################################################## |
859 | +# |
860 | +# product_tax_include module for OpenERP, Add new field for tax include in product |
861 | +# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE |
862 | +# |
863 | +# This file is a part of product_tax_include |
864 | +# |
865 | +# product_tax_include is free software: you can redistribute it and/or modify |
866 | +# it under the terms of the GNU General Public License as published by |
867 | +# the Free Software Foundation, either version 3 of the License, or |
868 | +# (at your option) any later version. |
869 | +# |
870 | +# product_tax_include is distributed in the hope that it will be useful, |
871 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
872 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
873 | +# GNU General Public License for more details. |
874 | +# |
875 | +# You should have received a copy of the GNU General Public License |
876 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
877 | +# |
878 | +############################################################################## |
879 | + |
880 | + |
881 | +from osv import osv |
882 | +from osv import fields |
883 | + |
884 | +class company(osv.osv): |
885 | + _inherit = 'res.company' |
886 | + _columns = { |
887 | + 'product_prices_tax_include': fields.boolean('Prices tax included', |
888 | + help="Product prices have tax included."), |
889 | + } |
890 | + _defaults = { |
891 | + 'product_prices_tax_include': lambda *a: True, |
892 | + } |
893 | + |
894 | +company() |
895 | + |
896 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
897 | |
898 | === added file 'product_tax_include/object/product.py' |
899 | --- product_tax_include/object/product.py 1970-01-01 00:00:00 +0000 |
900 | +++ product_tax_include/object/product.py 2010-05-20 07:24:29 +0000 |
901 | @@ -0,0 +1,74 @@ |
902 | +# -*- coding: utf-8 -*- |
903 | +############################################################################## |
904 | +# |
905 | +# product_tax_include module for OpenERP, Add new field for tax include in product |
906 | +# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE |
907 | +# |
908 | +# This file is a part of product_tax_include |
909 | +# |
910 | +# product_tax_include is free software: you can redistribute it and/or modify |
911 | +# it under the terms of the GNU General Public License as published by |
912 | +# the Free Software Foundation, either version 3 of the License, or |
913 | +# (at your option) any later version. |
914 | +# |
915 | +# product_tax_include is distributed in the hope that it will be useful, |
916 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
917 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
918 | +# GNU General Public License for more details. |
919 | +# |
920 | +# You should have received a copy of the GNU General Public License |
921 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
922 | +# |
923 | +############################################################################## |
924 | + |
925 | +from osv import fields |
926 | +from osv import osv |
927 | +from tools import config |
928 | + |
929 | +from tools.translate import _ |
930 | + |
931 | +class product_template(osv.osv): |
932 | + _inherit = 'product.template' |
933 | + |
934 | + def _price_unit_tax(self, cr, uid, ids, field_name, arg, context=None): |
935 | + """This method calcul the sale price with/without taxes included depending on company configuration""" |
936 | + if not context: context = {} |
937 | + res = {} |
938 | + tax_obj = self.pool.get('account.tax') |
939 | + users_obj = self.pool.get('res.users') |
940 | + user = users_obj.browse(cr, uid, uid, context) |
941 | + prices_tax_include = user.company_id.product_prices_tax_include |
942 | + cur_obj = self.pool.get('res.currency') |
943 | + cur = user.company_id.partner_id.property_product_pricelist.currency_id |
944 | + |
945 | + for product in self.browse(cr, uid, ids): |
946 | + val = 0.0 |
947 | + if prices_tax_include: |
948 | + val = reduce(lambda x, y: x+cur_obj.round(cr, uid, cur, y['amount']), |
949 | + tax_obj.compute_inv(cr, uid, product.taxes_id, |
950 | + product.list_price, 1), |
951 | + val) |
952 | + res[product.id] = cur_obj.round(cr, uid, cur, (product.list_price - val)) |
953 | + else: |
954 | + val = reduce(lambda x, y: x+cur_obj.round(cr, uid, cur, y['amount']), |
955 | + tax_obj.compute(cr, uid, product.taxes_id, |
956 | + product.list_price, 1), |
957 | + val) |
958 | + res[product.id] = cur_obj.round(cr, uid, cur, (product.list_price + val)) |
959 | + return res |
960 | + |
961 | + _columns = { |
962 | + 'price_unit_tax' : fields.function(_price_unit_tax, |
963 | + method=True, |
964 | + string='price inc./exc. tax', |
965 | + store=False, |
966 | + type='float', |
967 | + digits=(16, int(config['price_accuracy'])), |
968 | + help="Price calculated with taxes included or excluded, depend of the configuration in company configuration"), |
969 | + } |
970 | + |
971 | +product_template() |
972 | + |
973 | + |
974 | + |
975 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
976 | |
977 | === removed file 'product_tax_include/product.py' |
978 | --- product_tax_include/product.py 2010-05-19 08:34:42 +0000 |
979 | +++ product_tax_include/product.py 1970-01-01 00:00:00 +0000 |
980 | @@ -1,54 +0,0 @@ |
981 | -# -*- encoding: utf-8 -*- |
982 | -############################################################################## |
983 | -# |
984 | -# OpenERP, Open Source Management Solution |
985 | -# Copyright (C) 2004-2009 Smile.fr . All Rights Reserved |
986 | -# @author Raphaël Valyi, Amadou Diallo |
987 | -# |
988 | -# This program is free software: you can redistribute it and/or modify |
989 | -# it under the terms of the GNU General Public License as published by |
990 | -# the Free Software Foundation, either version 3 of the License, or |
991 | -# (at your option) any later version. |
992 | -# |
993 | -# This program is distributed in the hope that it will be useful, |
994 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
995 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
996 | -# GNU General Public License for more details. |
997 | -# |
998 | -# You should have received a copy of the GNU General Public License |
999 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1000 | -# |
1001 | -############################################################################## |
1002 | - |
1003 | -from osv import fields,osv |
1004 | - |
1005 | -class product_product(osv.osv): |
1006 | - _inherit = "product.product" |
1007 | - |
1008 | - def list_price_change(self, cr, uid, ids, list_price=False, sale_tax_ids=False): |
1009 | - res = {} |
1010 | - if sale_tax_ids: |
1011 | - sale_tax_ids = sale_tax_ids[0][2] #unwrapp the tax ids |
1012 | - price = list_price |
1013 | - product_taxes = self.pool.get('account.tax').browse(cr, uid, sale_tax_ids, {}) |
1014 | - for tax in self.pool.get('account.tax').compute(cr, uid, product_taxes, list_price, 1): |
1015 | - price += tax['amount'] |
1016 | - res = {'value':{'list_price_tax_incl':price}} |
1017 | - return res |
1018 | - |
1019 | - def list_price_tax_incl_change(self, cr, uid, ids, list_price_tax_incl=False, sale_tax_ids=False): |
1020 | - res = {} |
1021 | - if sale_tax_ids: |
1022 | - sale_tax_ids = sale_tax_ids[0][2] #unwrapp the tax ids |
1023 | - price = list_price_tax_incl |
1024 | - product_taxes = self.pool.get('account.tax').browse(cr, uid, sale_tax_ids, {}) |
1025 | - for tax in self.pool.get('account.tax').compute_inv(cr, uid, product_taxes, list_price_tax_incl, 1): |
1026 | - price -= tax['amount'] |
1027 | - res = {'value':{'list_price':price}} |
1028 | - return res |
1029 | - |
1030 | - |
1031 | - _columns = { |
1032 | - 'list_price_tax_incl': fields.float('Price Taxes Included'), |
1033 | - } |
1034 | -product_product() |
1035 | \ No newline at end of file |
1036 | |
1037 | === removed file 'product_tax_include/product_view.xml' |
1038 | --- product_tax_include/product_view.xml 2010-05-19 08:34:42 +0000 |
1039 | +++ product_tax_include/product_view.xml 1970-01-01 00:00:00 +0000 |
1040 | @@ -1,31 +0,0 @@ |
1041 | -<?xml version="1.0" encoding="utf-8"?> |
1042 | -<openerp> |
1043 | - <data> |
1044 | - |
1045 | - <record id="view_normal_product_tax_incl_form" model="ir.ui.view"> |
1046 | - <field name="name">view_normal_product_tax_incl_form</field> |
1047 | - <field name="model">product.product</field> |
1048 | - <field name="type">form</field> |
1049 | - <field name="inherit_id" ref="product.product_normal_form_view"/> |
1050 | - <field name="arch" type="xml"> |
1051 | - <field name="list_price" position="replace"> |
1052 | - <field name="list_price" on_change="list_price_change(list_price, taxes_id)"/> |
1053 | - <field name="list_price_tax_incl" on_change="list_price_tax_incl_change(list_price_tax_incl, taxes_id)"/> |
1054 | - </field> |
1055 | - </field> |
1056 | - </record> |
1057 | - |
1058 | - <record id="view_normal__product_tax_incl_tree" model="ir.ui.view"> |
1059 | - <field name="name">view_normal__product_tax_incl_tree</field> |
1060 | - <field name="model">product.product</field> |
1061 | - <field name="type">tree</field> |
1062 | - <field name="inherit_id" ref="product.product_product_tree_view"/> |
1063 | - <field name="arch" type="xml"> |
1064 | - <field name="standard_price" position="before"> |
1065 | - <field name="list_price_tax_incl" /> |
1066 | - </field> |
1067 | - </field> |
1068 | - </record> |
1069 | - |
1070 | - </data> |
1071 | -</openerp> |
1072 | \ No newline at end of file |
1073 | |
1074 | === added directory 'product_tax_include/view' |
1075 | === added file 'product_tax_include/view/company.xml' |
1076 | --- product_tax_include/view/company.xml 1970-01-01 00:00:00 +0000 |
1077 | +++ product_tax_include/view/company.xml 2010-05-20 07:24:29 +0000 |
1078 | @@ -0,0 +1,41 @@ |
1079 | +<?xml version="1.0" encoding="UTF-8"?> |
1080 | +<openerp> |
1081 | + <data> |
1082 | + ############################################################################## |
1083 | + # |
1084 | + # product_tax_include module for OpenERP, Add new field for tax include in product |
1085 | + # Copyright (C) 2009 SYLEAM Info Services ([http://www.Syleam.fr/]) Sebastien LANGE |
1086 | + # |
1087 | + # This file is a part of product_tax_include |
1088 | + # |
1089 | + # product_tax_include is free software: you can redistribute it and/or modify |
1090 | + # it under the terms of the GNU General Public License as published by |
1091 | + # the Free Software Foundation, either version 3 of the License, or |
1092 | + # (at your option) any later version. |
1093 | + # |
1094 | + # product_tax_include is distributed in the hope that it will be useful, |
1095 | + # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1096 | + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1097 | + # GNU General Public License for more details. |
1098 | + # |
1099 | + # You should have received a copy of the GNU General Public License |
1100 | + # along with this program. If not, see [http://www.gnu.org/licenses/]. |
1101 | + # |
1102 | + ############################################################################## |
1103 | + |
1104 | + <record id="product_company" model="ir.ui.view"> |
1105 | + <field name="name">res.company.product.config</field> |
1106 | + <field name="model">res.company</field> |
1107 | + <field name="type">form</field> |
1108 | + <field name="inherit_id" ref="base.view_company_form"/> |
1109 | + <field name="arch" type="xml"> |
1110 | + <page string="Configuration" position="inside"> |
1111 | + <separator string="Product" colspan="4"/> |
1112 | + <field name="product_prices_tax_include"/> |
1113 | + <newline/> |
1114 | + </page> |
1115 | + </field> |
1116 | + </record> |
1117 | + |
1118 | + </data> |
1119 | +</openerp> |
1120 | |
1121 | === added file 'product_tax_include/view/product.xml' |
1122 | --- product_tax_include/view/product.xml 1970-01-01 00:00:00 +0000 |
1123 | +++ product_tax_include/view/product.xml 2010-05-20 07:24:29 +0000 |
1124 | @@ -0,0 +1,38 @@ |
1125 | +<?xml version="1.0" encoding="UTF-8"?> |
1126 | +<openerp> |
1127 | + <data> |
1128 | + ############################################################################## |
1129 | + # |
1130 | + # product_tax_include module for OpenERP, Add new field for tax include in product |
1131 | + # Copyright (C) 2009 SYLEAM Info Services ([http://www.Syleam.fr/]) Sebastien LANGE |
1132 | + # |
1133 | + # This file is a part of product_tax_include |
1134 | + # |
1135 | + # product_tax_include is free software: you can redistribute it and/or modify |
1136 | + # it under the terms of the GNU General Public License as published by |
1137 | + # the Free Software Foundation, either version 3 of the License, or |
1138 | + # (at your option) any later version. |
1139 | + # |
1140 | + # product_tax_include is distributed in the hope that it will be useful, |
1141 | + # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1142 | + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1143 | + # GNU General Public License for more details. |
1144 | + # |
1145 | + # You should have received a copy of the GNU General Public License |
1146 | + # along with this program. If not, see [http://www.gnu.org/licenses/]. |
1147 | + # |
1148 | + ############################################################################## |
1149 | + |
1150 | + <record model="ir.ui.view" id="product_tax_include_form"> |
1151 | + <field name="name">product.tax.include</field> |
1152 | + <field name="model">product.product</field> |
1153 | + <field name="type">form</field> |
1154 | + <field name="inherit_id" ref="product.product_normal_form_view"/> |
1155 | + <field name="arch" type="xml"> |
1156 | + <field name="price_margin" position="after"> |
1157 | + <field name="price_unit_tax"/> |
1158 | + </field> |
1159 | + </field> |
1160 | + </record> |
1161 | + </data> |
1162 | +</openerp> |