Merge lp:~openbig/bigconsulting/onchange_to_cal_saleprice into lp:bigconsulting

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
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+25664@code.launchpad.net

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
=== modified file 'product_price_information/__terp__.py'
--- product_price_information/__terp__.py 2010-05-17 14:50:10 +0000
+++ product_price_information/__terp__.py 2010-05-20 07:24:29 +0000
@@ -29,7 +29,7 @@
29 and product view called from sale order line. Shop Price will display product price29 and product view called from sale order line. Shop Price will display product price
30 based on pricelist defined in shop selected in sale order. 30 based on pricelist defined in shop selected in sale order.
31 """,31 """,
32 "depends": ['sale'],32 "depends": ['sale','product_tax_include','sale_tax_include'],
33 "demo_xml": [],33 "demo_xml": [],
34 "update_xml": ['product_price_info_view.xml' ],34 "update_xml": ['product_price_info_view.xml' ],
35 "license": "GPL-3",35 "license": "GPL-3",
3636
=== modified file 'product_price_information/product_price_info.py'
--- product_price_information/product_price_info.py 2010-05-17 14:50:10 +0000
+++ product_price_information/product_price_info.py 2010-05-20 07:24:29 +0000
@@ -56,25 +56,88 @@
56class sale_order_line(osv.osv):56class sale_order_line(osv.osv):
57 _inherit = "sale.order.line"57 _inherit = "sale.order.line"
5858
59 def _compute_shop_price(self, cr, uid, ids, name, arg, context=None):59 _columns = {
60 if not context:60 'sale_price_unit_tax': fields.float('Sale price W/O taxes'),
61 context = {}61 }
62 res = {}62
63 pricelist_obj = self.pool.get('product.pricelist')63 def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
64 for so_line in self.browse(cr, uid, ids):64 uom=False, qty_uos=0, uos=False, name='', partner_id=False,
65 sale_order_id = so_line.order_id65 lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False):
66 shop_id = sale_order_id.shop_id66
67 if shop_id.pricelist_id:67 tax_obj = self.pool.get('account.tax')
68 pricelist_id = shop_id.pricelist_id.id68
69 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]69 result = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
70 else:70 uom, qty_uos, uos, name, partner_id, lang, update_tax, date_order, packaging, fiscal_position, flag)
71 pricelist_id = sale_order_id.pricelist_id.id71 if product:
72 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]72 context = {'lang': lang, 'partner_id': partner_id, 'qty': qty}
73 res[so_line.id] = price_unit73 product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
74 result['value']['sale_price_unit_tax'] = product_obj.product_tmpl_id.price_unit_tax
75
76 return result
77
78sale_order_line()
79
80class sale_order(osv.osv):
81 _name = "sale.order"
82 _inherit = "sale.order"
83
84 def onchange_shop_id(self, cr, uid, ids, shop_id):
85 res = super(sale_order, self).onchange_shop_id(cr, uid, id, shop_id)
86 if 'value' in res and shop_id:
87 res['value']['price_type'] = self.pool.get('sale.shop').browse(cr, uid , shop_id).price_type
74 return res88 return res
75
76 _columns = {
77 'shop_price': fields.function(_compute_shop_price, method=True, type='float', string='Shop Price', digits=(16, int(config['price_accuracy']))),
78 }
79
80sale_order_line()
81\ No newline at end of file89\ No newline at end of file
90
91sale_order()
92
93
94class sale_shop(osv.osv):
95 _name = 'sale.shop'
96 _inherit = 'sale.shop'
97 _columns = {
98 'price_type': fields.selection([
99 ('tax_included','Tax included'),
100 ('tax_excluded','Tax excluded')
101 ], 'Price method', required=True),
102 }
103 _defaults = {
104 'price_type': lambda *a: 'tax_included',
105 }
106
107sale_shop()
108
109class sale_shop_price_method_policy(osv.osv_memory):
110 _name = 'sale.shop.price.method'
111 _columns = {
112 'name': fields.char('Name', size=64),
113 'price_type': fields.selection([
114 ('tax_included','Tax included'),
115 ('tax_excluded','Tax excluded')
116 ], 'Price method', required=True),
117 }
118 _defaults = {
119 'price_type': lambda *a: 'tax_included',
120 }
121
122 def set_default(self, cr, uid, ids, context=None):
123 for o in self.browse(cr, uid, ids, context=context):
124 ir_values_obj = self.pool.get('ir.values')
125 print "o.price_type",o.price_type
126 ir_values_obj.set(cr, uid, 'default', False, 'price_type', ['sale.shop'], o.price_type)
127 return {
128 'view_type': 'form',
129 "view_mode": 'form',
130 'res_model': 'ir.actions.configuration.wizard',
131 'type': 'ir.actions.act_window',
132 'target': 'new',
133 }
134
135 def action_cancel(self,cr,uid,ids,conect=None):
136 return {
137 'view_type': 'form',
138 "view_mode": 'form',
139 'res_model': 'ir.actions.configuration.wizard',
140 'type': 'ir.actions.act_window',
141 'target':'new',
142 }
143
144sale_shop_price_method_policy()
82\ No newline at end of file145\ No newline at end of file
83146
=== modified file 'product_price_information/product_price_info_view.xml'
--- product_price_information/product_price_info_view.xml 2010-05-17 14:50:10 +0000
+++ product_price_information/product_price_info_view.xml 2010-05-20 07:24:29 +0000
@@ -43,7 +43,8 @@
43 </xpath>43 </xpath>
44 </field> 44 </field>
45 </record>45 </record>
46 46
47
47<!-- Adding shop price field on sale order line form below Unit Price -->48<!-- Adding shop price field on sale order line form below Unit Price -->
4849
49 <record model="ir.ui.view" id="view_sale_order_line_tree_direct_delivery">50 <record model="ir.ui.view" id="view_sale_order_line_tree_direct_delivery">
@@ -53,10 +54,64 @@
53 <field name="type">form</field>54 <field name="type">form</field>
54 <field name="arch" type="xml">55 <field name="arch" type="xml">
55 <xpath expr="//field[@name='discount']" position="after">56 <xpath expr="//field[@name='discount']" position="after">
56 <field name="shop_price"/>57 <field name="sale_price_unit_tax"/>
57 </xpath>58 </xpath>
58 </field>59 </field>
59 </record>60 </record>
61
62 <record model="ir.ui.view" id="product_tax_include_tree">
63 <field name="name">product.tax.include.tree</field>
64 <field name="model">product.product</field>
65 <field name="type">form</field>
66 <field name="inherit_id" ref="product.product_product_tree_view"/>
67 <field name="arch" type="xml">
68 <field name="lst_price" position="before">
69 <field name="price_unit_tax"/>
70 </field>
71 </field>
72 </record>
73
74 <record id="view_partner_property_form" model="ir.ui.view">
75 <field name="name">sale.shop.property.form.inherit</field>
76 <field name="model">sale.shop</field>
77 <field name="type">form</field>
78 <field name="inherit_id" ref="sale.view_shop_form"/>
79 <field name="arch" type="xml">
80 <field name="project_id" position="after">
81 <field name="price_type"/>
82 </field>
83 </field>
84 </record>
85
86 <record id="view_config_price_policy" model="ir.ui.view">
87 <field name="name">Price Method for Sale Order Shop</field>
88 <field name="model">sale.shop.price.method</field>
89 <field name="type">form</field>
90 <field name="arch" type="xml">
91 <form string="Shop Configuration">
92 <field name="price_type"/>
93 <newline/>
94 <group col="4" colspan="4">
95 <button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
96 <button icon="gtk-ok" name="set_default" string="Set Default" type="object"/>
97 </group>
98 </form>
99 </field>
100 </record>
101
102 <record id="action_config_price_policy" model="ir.actions.act_window">
103 <field name="name">Price Method for Sale Order Shop</field>
104 <field name="type">ir.actions.act_window</field>
105 <field name="res_model">sale.shop.price.method</field>
106 <field name="view_type">form</field>
107 <field name="view_mode">form</field>
108 <field name="target">new</field>
109 </record>
110
111 <record id="config_wizard_step_shop_price_policy" model="ir.actions.todo">
112 <field name="name">Shop Price</field>
113 <field name="action_id" ref="action_config_price_policy"/>
114 </record>
60 115
61 </data>116 </data>
62</openerp>117</openerp>
63118
=== added file 'product_tax_include/.license'
--- product_tax_include/.license 1970-01-01 00:00:00 +0000
+++ product_tax_include/.license 2010-05-20 07:24:29 +0000
@@ -0,0 +1,21 @@
1##############################################################################
2#
3# product_tax_include module for OpenERP, Add new field for tax include in product
4# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE
5#
6# This file is a part of product_tax_include
7#
8# product_tax_include is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# product_tax_include is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
022
=== modified file 'product_tax_include/__init__.py' (properties changed: +x to -x)
--- product_tax_include/__init__.py 2010-05-19 08:34:42 +0000
+++ product_tax_include/__init__.py 2010-05-20 07:24:29 +0000
@@ -1,1 +1,28 @@
1import product
2\ No newline at end of file1\ No newline at end of file
2# -*- coding: utf-8 -*-
3##############################################################################
4#
5# product_tax_include module for OpenERP, Add new field for tax include in product
6# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE
7#
8# This file is a part of product_tax_include
9#
10# product_tax_include is free software: you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# product_tax_include is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22#
23##############################################################################
24
25import object
26import report
27import wizard
28
29# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3\ No newline at end of file30\ No newline at end of file
431
=== modified file 'product_tax_include/__terp__.py' (properties changed: +x to -x)
--- product_tax_include/__terp__.py 2010-05-19 08:34:42 +0000
+++ product_tax_include/__terp__.py 2010-05-20 07:24:29 +0000
@@ -1,16 +1,17 @@
1# -*- encoding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3#3#
4# OpenERP, Open Source Management Solution 4# product_tax_include module for OpenERP, Add new field for tax include in product
5# Copyright (C) 2009 Smile.fr. All Rights Reserved5# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE
6# author: Raphaƫl Valyi, Amadou Diallo6#
7#7# This file is a part of product_tax_include
8# This program is free software: you can redistribute it and/or modify8#
9# product_tax_include is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by10# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or11# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.12# (at your option) any later version.
12#13#
13# This program is distributed in the hope that it will be useful,14# product_tax_include is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of15# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.17# GNU General Public License for more details.
@@ -19,22 +20,32 @@
19# along with this program. If not, see <http://www.gnu.org/licenses/>.20# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#21#
21##############################################################################22##############################################################################
23
22{24{
23 "name" : "Product Tax Include",25 'name': 'Product Tax Include',
24 "description":"""Product Tax Include26 'version': '0.0.1',
25Allows to compute the base sale untaxed amount given a taxed amount entry (change the list_price on on_change)27 'category': 'Generic Modules/Inventory Control',
26and reciprocally.28 'description': """Add new field for tax include in product
27 """,29
28 "version" : "0.1",30 OpenERP version : 5.0
29 "author" : "Smile.fr",31 Creation : 2009-12-05
30 "category" : "Custom",32 Last update : 2009-12-05
31 "depends" : ["product", "account"],33""",
32 "init_xml" : [],34 'author': 'SYLEAM Info Services',
33 "demo_xml" : [],35 'depends': [
34 "update_xml" : ["product_view.xml"],36 "base",
35 "active": False,37 "product",
36 "installable": True38 "account_tax_include",
39 ],
40 'init_xml': [],
41 'update_xml': [
42 "view/company.xml",
43 "view/product.xml",
44 ],
45 'demo_xml': [],
46 'installable': True,
47 'active': False,
48 'license': 'GPL-3',
37}49}
50
38# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:51# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
39
40#,"product_variant_configurator_wizard.xml"
41\ No newline at end of file52\ No newline at end of file
4253
=== added directory 'product_tax_include/i18n'
=== added file 'product_tax_include/i18n/ca.po'
--- product_tax_include/i18n/ca.po 1970-01-01 00:00:00 +0000
+++ product_tax_include/i18n/ca.po 2010-05-20 07:24:29 +0000
@@ -0,0 +1,78 @@
1# Catalan translation for openobject-addons
2# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
3# This file is distributed under the same license as the openobject-addons package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
5#
6msgid ""
7msgstr ""
8"Project-Id-Version: openobject-addons\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2009-12-05 14:38+0000\n"
11"PO-Revision-Date: 2009-12-07 06:02+0000\n"
12"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com "
13"<jesteve@zikzakmedia.com>\n"
14"Language-Team: Catalan <ca@li.org>\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=UTF-8\n"
17"Content-Transfer-Encoding: 8bit\n"
18"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n"
19"X-Generator: Launchpad (build Unknown)\n"
20
21#. module: product_tax_include
22#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information
23msgid "Product Tax Include"
24msgstr "Productes amb impostos inclosos"
25
26#. module: product_tax_include
27#: constraint:ir.ui.view:0
28msgid "Invalid XML for View Architecture!"
29msgstr "ļ»æXML invĆ lid per a la definiciĆ³ de la vista!"
30
31#. module: product_tax_include
32#: help:product.template,price_unit_tax:0
33msgid ""
34"Price calculated with taxes included or excluded, depend of the "
35"configuration in company configuration"
36msgstr ""
37"Preu calculat amb impostos inclosos o exclosos, depenent de la configuraciĆ³ "
38"de la companyia."
39
40#. module: product_tax_include
41#: view:res.company:0
42msgid "Product"
43msgstr "Producte"
44
45#. module: product_tax_include
46#: field:product.template,price_unit_tax:0
47msgid "Sale price with taxes included or excluded"
48msgstr "Preu de venda amb impostos inclosos o exclosos"
49
50#. module: product_tax_include
51#: field:res.company,product_prices_tax_include:0
52msgid "Prices tax included"
53msgstr "Preus impostos inclosos"
54
55#. module: product_tax_include
56#: help:res.company,product_prices_tax_include:0
57msgid "Product prices have tax included."
58msgstr "Els preus del producte tenen els impostos inclosos."
59
60#. module: product_tax_include
61#: view:res.company:0
62msgid "Configuration"
63msgstr "ConfiguraciĆ³"
64
65#. module: product_tax_include
66#: model:ir.module.module,description:product_tax_include.module_meta_information
67msgid ""
68"Add new field for tax include in product\n"
69"\n"
70" OpenERP version : 5.0\n"
71" Creation : 2009-12-05\n"
72" Last update : 2009-12-05\n"
73msgstr ""
74"Afegeix un nou camp per als impostos inclosos en els preus del producte\n"
75"\n"
76" OpenERP versiĆ³ : 5.0\n"
77" CreaciĆ³ : 05-12-2009\n"
78" ƚltima actualitzaciĆ³ : 05-12-2009\n"
079
=== added file 'product_tax_include/i18n/es.po'
--- product_tax_include/i18n/es.po 1970-01-01 00:00:00 +0000
+++ product_tax_include/i18n/es.po 2010-05-20 07:24:29 +0000
@@ -0,0 +1,79 @@
1# Spanish translation for openobject-addons
2# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
3# This file is distributed under the same license as the openobject-addons package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
5#
6msgid ""
7msgstr ""
8"Project-Id-Version: openobject-addons\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2009-12-05 14:38+0000\n"
11"PO-Revision-Date: 2009-12-06 06:03+0000\n"
12"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com "
13"<jesteve@zikzakmedia.com>\n"
14"Language-Team: Spanish <es@li.org>\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=UTF-8\n"
17"Content-Transfer-Encoding: 8bit\n"
18"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n"
19"X-Generator: Launchpad (build Unknown)\n"
20
21#. module: product_tax_include
22#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information
23msgid "Product Tax Include"
24msgstr "Productos con impuestos incluidos"
25
26#. module: product_tax_include
27#: constraint:ir.ui.view:0
28msgid "Invalid XML for View Architecture!"
29msgstr "Ā”XML invĆ”lido para la definiciĆ³n de la vista!"
30
31#. module: product_tax_include
32#: help:product.template,price_unit_tax:0
33msgid ""
34"Price calculated with taxes included or excluded, depend of the "
35"configuration in company configuration"
36msgstr ""
37"Precio calculado con impuestos incluidos o excluidos, dependiendo de la "
38"configuraciĆ³n de la compaƱƭa."
39
40#. module: product_tax_include
41#: view:res.company:0
42msgid "Product"
43msgstr "Producto"
44
45#. module: product_tax_include
46#: field:product.template,price_unit_tax:0
47msgid "Sale price with taxes included or excluded"
48msgstr "Precio de venta con impuestos incluidos o excluidos"
49
50#. module: product_tax_include
51#: field:res.company,product_prices_tax_include:0
52msgid "Prices tax included"
53msgstr "Precios impuestos incluidos"
54
55#. module: product_tax_include
56#: help:res.company,product_prices_tax_include:0
57msgid "Product prices have tax included."
58msgstr "Los precios del producto tienen los impuestos incluidos."
59
60#. module: product_tax_include
61#: view:res.company:0
62msgid "Configuration"
63msgstr "ConfiguraciĆ³n"
64
65#. module: product_tax_include
66#: model:ir.module.module,description:product_tax_include.module_meta_information
67msgid ""
68"Add new field for tax include in product\n"
69"\n"
70" OpenERP version : 5.0\n"
71" Creation : 2009-12-05\n"
72" Last update : 2009-12-05\n"
73msgstr ""
74"AƱade un nuevo campo para los impuestos incluidos en los precios del "
75"producto\n"
76"\n"
77" OpenERP versiĆ³n : 5.0\n"
78" CreaciĆ³n : 05-12-2009\n"
79" ƚltima actualizaciĆ³n : 05-12-2009\n"
080
=== added file 'product_tax_include/i18n/fr.po'
--- product_tax_include/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ product_tax_include/i18n/fr.po 2010-05-20 07:24:29 +0000
@@ -0,0 +1,71 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_tax_include
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 5.0.6\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2009-12-05 14:38+0000\n"
10"PO-Revision-Date: 2009-12-05 16:27+0000\n"
11"Last-Translator: Sebastien LANGE - http://www.Syleam.fr <Unknown>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n"
17"X-Generator: Launchpad (build Unknown)\n"
18
19#. module: product_tax_include
20#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information
21msgid "Product Tax Include"
22msgstr ""
23
24#. module: product_tax_include
25#: constraint:ir.ui.view:0
26msgid "Invalid XML for View Architecture!"
27msgstr "Formulaire XML invalide pour ce type de vue"
28
29#. module: product_tax_include
30#: help:product.template,price_unit_tax:0
31msgid ""
32"Price calculated with taxes included or excluded, depend of the "
33"configuration in company configuration"
34msgstr ""
35"Prix calculƩ avec taxes incluses ou excluses, dƩpend du paramƩtrage dans la "
36"sociƩtƩ"
37
38#. module: product_tax_include
39#: view:res.company:0
40msgid "Product"
41msgstr "Produit"
42
43#. module: product_tax_include
44#: field:product.template,price_unit_tax:0
45msgid "Sale price with taxes included or excluded"
46msgstr "Prix de vente avec taxes incluses ou excluses"
47
48#. module: product_tax_include
49#: field:res.company,product_prices_tax_include:0
50msgid "Prices tax included"
51msgstr "Taxes incluses dans le prix"
52
53#. module: product_tax_include
54#: help:res.company,product_prices_tax_include:0
55msgid "Product prices have tax included."
56msgstr "Taxes incluses dans le prix du produit"
57
58#. module: product_tax_include
59#: view:res.company:0
60msgid "Configuration"
61msgstr "Configuration"
62
63#. module: product_tax_include
64#: model:ir.module.module,description:product_tax_include.module_meta_information
65msgid ""
66"Add new field for tax include in product\n"
67"\n"
68" OpenERP version : 5.0\n"
69" Creation : 2009-12-05\n"
70" Last update : 2009-12-05\n"
71msgstr ""
072
=== added file 'product_tax_include/i18n/fr_FR.po'
--- product_tax_include/i18n/fr_FR.po 1970-01-01 00:00:00 +0000
+++ product_tax_include/i18n/fr_FR.po 2010-05-20 07:24:29 +0000
@@ -0,0 +1,66 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_tax_include
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 5.0.6\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2009-12-05 14:39:03+0000\n"
10"PO-Revision-Date: 2009-12-05 14:39:03+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: product_tax_include
19#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information
20msgid "Product Tax Include"
21msgstr ""
22
23#. module: product_tax_include
24#: constraint:ir.ui.view:0
25msgid "Invalid XML for View Architecture!"
26msgstr "Formulaire XML invalide pour ce type de vue"
27
28#. module: product_tax_include
29#: help:product.template,price_unit_tax:0
30msgid "Price calculated with taxes included or excluded, depend of the configuration in company configuration"
31msgstr "Prix calculƩ avec taxes incluses ou excluses, dƩpend du paramƩtrage dans la sociƩtƩ"
32
33#. module: product_tax_include
34#: view:res.company:0
35msgid "Product"
36msgstr "Produit"
37
38#. module: product_tax_include
39#: field:product.template,price_unit_tax:0
40msgid "Sale price with taxes included or excluded"
41msgstr "Prix de vente avec taxes incluses ou excluses"
42
43#. module: product_tax_include
44#: field:res.company,product_prices_tax_include:0
45msgid "Prices tax included"
46msgstr "Taxes incluses dans le prix"
47
48#. module: product_tax_include
49#: help:res.company,product_prices_tax_include:0
50msgid "Product prices have tax included."
51msgstr "Taxes incluses dans le prix du produit"
52
53#. module: product_tax_include
54#: view:res.company:0
55msgid "Configuration"
56msgstr "Configuration"
57
58#. module: product_tax_include
59#: model:ir.module.module,description:product_tax_include.module_meta_information
60msgid "Add new field for tax include in product\n"
61"\n"
62" OpenERP version : 5.0\n"
63" Creation : 2009-12-05\n"
64" Last update : 2009-12-05\n"
65""
66msgstr ""
067
=== added file 'product_tax_include/i18n/product_tax_include.pot'
--- product_tax_include/i18n/product_tax_include.pot 1970-01-01 00:00:00 +0000
+++ product_tax_include/i18n/product_tax_include.pot 2010-05-20 07:24:29 +0000
@@ -0,0 +1,67 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_tax_include
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 5.0.6\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2009-12-05 14:38:47+0000\n"
10"PO-Revision-Date: 2009-12-05 14:38:47+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: product_tax_include
19#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information
20msgid "Product Tax Include"
21msgstr ""
22
23#. module: product_tax_include
24#: constraint:ir.ui.view:0
25msgid "Invalid XML for View Architecture!"
26msgstr ""
27
28#. module: product_tax_include
29#: help:product.template,price_unit_tax:0
30msgid "Price calculated with taxes included or excluded, depend of the configuration in company configuration"
31msgstr ""
32
33#. module: product_tax_include
34#: view:res.company:0
35msgid "Product"
36msgstr ""
37
38#. module: product_tax_include
39#: field:product.template,price_unit_tax:0
40msgid "Sale price with taxes included or excluded"
41msgstr ""
42
43#. module: product_tax_include
44#: field:res.company,product_prices_tax_include:0
45msgid "Prices tax included"
46msgstr ""
47
48#. module: product_tax_include
49#: help:res.company,product_prices_tax_include:0
50msgid "Product prices have tax included."
51msgstr ""
52
53#. module: product_tax_include
54#: view:res.company:0
55msgid "Configuration"
56msgstr ""
57
58#. module: product_tax_include
59#: model:ir.module.module,description:product_tax_include.module_meta_information
60msgid "Add new field for tax include in product\n"
61"\n"
62" OpenERP version : 5.0\n"
63" Creation : 2009-12-05\n"
64" Last update : 2009-12-05\n"
65""
66msgstr ""
67
068
=== added file 'product_tax_include/i18n/pt.po'
--- product_tax_include/i18n/pt.po 1970-01-01 00:00:00 +0000
+++ product_tax_include/i18n/pt.po 2010-05-20 07:24:29 +0000
@@ -0,0 +1,77 @@
1# Portuguese translation for openobject-addons
2# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
3# This file is distributed under the same license as the openobject-addons package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
5#
6msgid ""
7msgstr ""
8"Project-Id-Version: openobject-addons\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2009-12-05 14:38+0000\n"
11"PO-Revision-Date: 2009-12-10 06:00+0000\n"
12"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
13"Language-Team: Portuguese <pt@li.org>\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
17"X-Launchpad-Export-Date: 2010-04-09 04:01+0000\n"
18"X-Generator: Launchpad (build Unknown)\n"
19
20#. module: product_tax_include
21#: model:ir.module.module,shortdesc:product_tax_include.module_meta_information
22msgid "Product Tax Include"
23msgstr "Artigos Imposto incluido"
24
25#. module: product_tax_include
26#: constraint:ir.ui.view:0
27msgid "Invalid XML for View Architecture!"
28msgstr "XML invƔlido para a arquitectura da vista"
29
30#. module: product_tax_include
31#: help:product.template,price_unit_tax:0
32msgid ""
33"Price calculated with taxes included or excluded, depend of the "
34"configuration in company configuration"
35msgstr ""
36"PreƧo calculado com impostos incluƭdos ou excluƭdos, dependendo da "
37"configuraĆ§Ć£o da companhia."
38
39#. module: product_tax_include
40#: view:res.company:0
41msgid "Product"
42msgstr "Artigo"
43
44#. module: product_tax_include
45#: field:product.template,price_unit_tax:0
46msgid "Sale price with taxes included or excluded"
47msgstr "PreƧo de venda com impostos incluƭdos ou excluƭdos"
48
49#. module: product_tax_include
50#: field:res.company,product_prices_tax_include:0
51msgid "Prices tax included"
52msgstr "PreƧo com impostos incluƭdos"
53
54#. module: product_tax_include
55#: help:res.company,product_prices_tax_include:0
56msgid "Product prices have tax included."
57msgstr "Os preƧos dos artigos tĆŖm imposto incluĆ­do."
58
59#. module: product_tax_include
60#: view:res.company:0
61msgid "Configuration"
62msgstr "ConfiguraĆ§Ć£o"
63
64#. module: product_tax_include
65#: model:ir.module.module,description:product_tax_include.module_meta_information
66msgid ""
67"Add new field for tax include in product\n"
68"\n"
69" OpenERP version : 5.0\n"
70" Creation : 2009-12-05\n"
71" Last update : 2009-12-05\n"
72msgstr ""
73"Adiciona um novo campoem artigos para impostos incluĆ­dos\n"
74"\n"
75" OpenERP versĆ£o : 5.0\n"
76" CriaĆ§Ć£o : 2009-12-05\n"
77" ƚltima actualizaĆ§Ć£o : 2009-12-05\n"
078
=== added directory 'product_tax_include/object'
=== added file 'product_tax_include/object/__init__.py'
--- product_tax_include/object/__init__.py 1970-01-01 00:00:00 +0000
+++ product_tax_include/object/__init__.py 2010-05-20 07:24:29 +0000
@@ -0,0 +1,27 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# product_tax_include module for OpenERP, Add new field for tax include in product
5# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE
6#
7# This file is a part of product_tax_include
8#
9# product_tax_include is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# product_tax_include is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24import product
25import company
26
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
028
=== added file 'product_tax_include/object/company.py'
--- product_tax_include/object/company.py 1970-01-01 00:00:00 +0000
+++ product_tax_include/object/company.py 2010-05-20 07:24:29 +0000
@@ -0,0 +1,40 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# product_tax_include module for OpenERP, Add new field for tax include in product
5# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE
6#
7# This file is a part of product_tax_include
8#
9# product_tax_include is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# product_tax_include is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24
25from osv import osv
26from osv import fields
27
28class company(osv.osv):
29 _inherit = 'res.company'
30 _columns = {
31 'product_prices_tax_include': fields.boolean('Prices tax included',
32 help="Product prices have tax included."),
33 }
34 _defaults = {
35 'product_prices_tax_include': lambda *a: True,
36 }
37
38company()
39
40# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
041
=== added file 'product_tax_include/object/product.py'
--- product_tax_include/object/product.py 1970-01-01 00:00:00 +0000
+++ product_tax_include/object/product.py 2010-05-20 07:24:29 +0000
@@ -0,0 +1,74 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# product_tax_include module for OpenERP, Add new field for tax include in product
5# Copyright (C) 2009 SYLEAM Info Services (<http://www.Syleam.fr/>) Sebastien LANGE
6#
7# This file is a part of product_tax_include
8#
9# product_tax_include is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# product_tax_include is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24from osv import fields
25from osv import osv
26from tools import config
27
28from tools.translate import _
29
30class product_template(osv.osv):
31 _inherit = 'product.template'
32
33 def _price_unit_tax(self, cr, uid, ids, field_name, arg, context=None):
34 """This method calcul the sale price with/without taxes included depending on company configuration"""
35 if not context: context = {}
36 res = {}
37 tax_obj = self.pool.get('account.tax')
38 users_obj = self.pool.get('res.users')
39 user = users_obj.browse(cr, uid, uid, context)
40 prices_tax_include = user.company_id.product_prices_tax_include
41 cur_obj = self.pool.get('res.currency')
42 cur = user.company_id.partner_id.property_product_pricelist.currency_id
43
44 for product in self.browse(cr, uid, ids):
45 val = 0.0
46 if prices_tax_include:
47 val = reduce(lambda x, y: x+cur_obj.round(cr, uid, cur, y['amount']),
48 tax_obj.compute_inv(cr, uid, product.taxes_id,
49 product.list_price, 1),
50 val)
51 res[product.id] = cur_obj.round(cr, uid, cur, (product.list_price - val))
52 else:
53 val = reduce(lambda x, y: x+cur_obj.round(cr, uid, cur, y['amount']),
54 tax_obj.compute(cr, uid, product.taxes_id,
55 product.list_price, 1),
56 val)
57 res[product.id] = cur_obj.round(cr, uid, cur, (product.list_price + val))
58 return res
59
60 _columns = {
61 'price_unit_tax' : fields.function(_price_unit_tax,
62 method=True,
63 string='price inc./exc. tax',
64 store=False,
65 type='float',
66 digits=(16, int(config['price_accuracy'])),
67 help="Price calculated with taxes included or excluded, depend of the configuration in company configuration"),
68 }
69
70product_template()
71
72
73
74# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
075
=== removed file 'product_tax_include/product.py'
--- product_tax_include/product.py 2010-05-19 08:34:42 +0000
+++ product_tax_include/product.py 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2009 Smile.fr . All Rights Reserved
6# @author Raphaƫl Valyi, Amadou Diallo
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields,osv
24
25class product_product(osv.osv):
26 _inherit = "product.product"
27
28 def list_price_change(self, cr, uid, ids, list_price=False, sale_tax_ids=False):
29 res = {}
30 if sale_tax_ids:
31 sale_tax_ids = sale_tax_ids[0][2] #unwrapp the tax ids
32 price = list_price
33 product_taxes = self.pool.get('account.tax').browse(cr, uid, sale_tax_ids, {})
34 for tax in self.pool.get('account.tax').compute(cr, uid, product_taxes, list_price, 1):
35 price += tax['amount']
36 res = {'value':{'list_price_tax_incl':price}}
37 return res
38
39 def list_price_tax_incl_change(self, cr, uid, ids, list_price_tax_incl=False, sale_tax_ids=False):
40 res = {}
41 if sale_tax_ids:
42 sale_tax_ids = sale_tax_ids[0][2] #unwrapp the tax ids
43 price = list_price_tax_incl
44 product_taxes = self.pool.get('account.tax').browse(cr, uid, sale_tax_ids, {})
45 for tax in self.pool.get('account.tax').compute_inv(cr, uid, product_taxes, list_price_tax_incl, 1):
46 price -= tax['amount']
47 res = {'value':{'list_price':price}}
48 return res
49
50
51 _columns = {
52 'list_price_tax_incl': fields.float('Price Taxes Included'),
53 }
54product_product()
55\ No newline at end of file0\ No newline at end of file
561
=== removed file 'product_tax_include/product_view.xml'
--- product_tax_include/product_view.xml 2010-05-19 08:34:42 +0000
+++ product_tax_include/product_view.xml 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="view_normal_product_tax_incl_form" model="ir.ui.view">
6 <field name="name">view_normal_product_tax_incl_form</field>
7 <field name="model">product.product</field>
8 <field name="type">form</field>
9 <field name="inherit_id" ref="product.product_normal_form_view"/>
10 <field name="arch" type="xml">
11 <field name="list_price" position="replace">
12 <field name="list_price" on_change="list_price_change(list_price, taxes_id)"/>
13 <field name="list_price_tax_incl" on_change="list_price_tax_incl_change(list_price_tax_incl, taxes_id)"/>
14 </field>
15 </field>
16 </record>
17
18 <record id="view_normal__product_tax_incl_tree" model="ir.ui.view">
19 <field name="name">view_normal__product_tax_incl_tree</field>
20 <field name="model">product.product</field>
21 <field name="type">tree</field>
22 <field name="inherit_id" ref="product.product_product_tree_view"/>
23 <field name="arch" type="xml">
24 <field name="standard_price" position="before">
25 <field name="list_price_tax_incl" />
26 </field>
27 </field>
28 </record>
29
30 </data>
31</openerp>
32\ No newline at end of file0\ No newline at end of file
331
=== added directory 'product_tax_include/view'
=== added file 'product_tax_include/view/company.xml'
--- product_tax_include/view/company.xml 1970-01-01 00:00:00 +0000
+++ product_tax_include/view/company.xml 2010-05-20 07:24:29 +0000
@@ -0,0 +1,41 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 ##############################################################################
5 #
6 # product_tax_include module for OpenERP, Add new field for tax include in product
7 # Copyright (C) 2009 SYLEAM Info Services ([http://www.Syleam.fr/]) Sebastien LANGE
8 #
9 # This file is a part of product_tax_include
10 #
11 # product_tax_include is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
15 #
16 # product_tax_include is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program. If not, see [http://www.gnu.org/licenses/].
23 #
24 ##############################################################################
25
26 <record id="product_company" model="ir.ui.view">
27 <field name="name">res.company.product.config</field>
28 <field name="model">res.company</field>
29 <field name="type">form</field>
30 <field name="inherit_id" ref="base.view_company_form"/>
31 <field name="arch" type="xml">
32 <page string="Configuration" position="inside">
33 <separator string="Product" colspan="4"/>
34 <field name="product_prices_tax_include"/>
35 <newline/>
36 </page>
37 </field>
38 </record>
39
40 </data>
41</openerp>
042
=== added file 'product_tax_include/view/product.xml'
--- product_tax_include/view/product.xml 1970-01-01 00:00:00 +0000
+++ product_tax_include/view/product.xml 2010-05-20 07:24:29 +0000
@@ -0,0 +1,38 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 ##############################################################################
5 #
6 # product_tax_include module for OpenERP, Add new field for tax include in product
7 # Copyright (C) 2009 SYLEAM Info Services ([http://www.Syleam.fr/]) Sebastien LANGE
8 #
9 # This file is a part of product_tax_include
10 #
11 # product_tax_include is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
15 #
16 # product_tax_include is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program. If not, see [http://www.gnu.org/licenses/].
23 #
24 ##############################################################################
25
26 <record model="ir.ui.view" id="product_tax_include_form">
27 <field name="name">product.tax.include</field>
28 <field name="model">product.product</field>
29 <field name="type">form</field>
30 <field name="inherit_id" ref="product.product_normal_form_view"/>
31 <field name="arch" type="xml">
32 <field name="price_margin" position="after">
33 <field name="price_unit_tax"/>
34 </field>
35 </field>
36 </record>
37 </data>
38</openerp>

Subscribers

People subscribed via source and target branches