Merge lp:~therp-nl/openerp-product-attributes/7.0_lp1272282_fixed_price into lp:~product-core-editors/openerp-product-attributes/7.0
- 7.0_lp1272282_fixed_price
- Merge into 7.0
Status: | Rejected |
---|---|
Rejected by: | Guewen Baconnier @ Camptocamp |
Proposed branch: | lp:~therp-nl/openerp-product-attributes/7.0_lp1272282_fixed_price |
Merge into: | lp:~product-core-editors/openerp-product-attributes/7.0 |
Diff against target: |
1642 lines (+904/-614) 17 files modified
product_pricelist_fixed_price/AUTHORS.txt (+2/-0) product_pricelist_fixed_price/__init__.py (+1/-20) product_pricelist_fixed_price/__openerp__.py (+11/-9) product_pricelist_fixed_price/i18n/ca.po (+0/-65) product_pricelist_fixed_price/i18n/de.po (+0/-65) product_pricelist_fixed_price/i18n/es.po (+0/-65) product_pricelist_fixed_price/i18n/it.po (+0/-64) product_pricelist_fixed_price/i18n/nl.po (+175/-0) product_pricelist_fixed_price/i18n/product_pricelist_fixed_price.pot (+147/-39) product_pricelist_fixed_price/model/__init__.py (+5/-0) product_pricelist_fixed_price/model/product_pricelist.py (+34/-0) product_pricelist_fixed_price/model/product_pricelist_item.py (+117/-0) product_pricelist_fixed_price/model/product_pricelist_version.py (+35/-0) product_pricelist_fixed_price/pricelist.py (+0/-211) product_pricelist_fixed_price/pricelist_view.xml (+0/-76) product_pricelist_fixed_price/view/pricelist_menu.xml (+109/-0) product_pricelist_fixed_price/view/pricelist_view.xml (+268/-0) |
To merge this branch: | bzr merge lp:~therp-nl/openerp-product-attributes/7.0_lp1272282_fixed_price |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guewen Baconnier @ Camptocamp | Needs Information | ||
Yannick Vaucher @ Camptocamp | Disapprove | ||
Lionel Sausin - Initiatives/Numérigraphe (community) | functionnal and code | Approve | |
Pedro Manuel Baeza | Needs Fixing | ||
Leonardo Pistone | Abstain | ||
Ronald Portier (Therp) (community) | Needs Resubmitting | ||
Review via email: mp+203348@code.launchpad.net |
Commit message
Description of the change
Replace original code to make it compatible with 7.0.
I used the trick to have -1 for the price discount and put the fixed price in price_surcharge.
This will create a price: (base_price * (1 + price_discount)) + price_surcharge =
(base_price * (1 -1)) + price_surcharge = price_surcharge.
Therefore OpenERP will do all its normal computations (including currency-
Leonardo Pistone (lepistone) wrote : | # |
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote : | # |
The 100% discount trick is what we currently do in a non-automatic sort of way, and it looks like this module is just what I expected to develop some day to make it easier.
So we're quite willing to test this, but please allow a few days before we can give a feedback.
Lorenzo Battistini (elbati) wrote : | # |
From a functional point of view, I approve the -1 trick.
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote : | # |
Functional: Worked for me, no problem.
I only wish it was possible to mix fixed price rules and standard ones, so we could get rules like
- product A = 1€
- product B = 3€
- other products = sale price + 10%
But this is something that we can change later, it should not block this MP.
GUI:
The form layout for the fixed price list version is slightly wrong (the number of cols must be wrong I guess).
Would you mind making the list view of pricelist lines editable? That would make it much faster to enter.
Code:
I suggest you merge the content of "model/" in a single file at the upper level directory to make consistent with the other modules.
There are spaces at the end of lots of lines, would you care to remove them please?
Can you please make the docstring for the check_*() functions more explicit that "Raise exception when error found", like maybe "Ensure the fixed prices are in fixed pricelists"?
The docstring states that "_compute_vals()" mutates the argument "vals", so I'd be more comfortable if it was called "_adapt_vals()" or something likely explicit.
In _compute_vals you don't use the context, so please remove "context = context or {}"
In write(),the context is missing from the browse() call.
The python files lack copyright comments, is that OK?
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Without demeriting your work, IMHO a better approach would be to include a field calle type_extended or something similar on product.
Regards.
- 232. By Ronald Portier (Therp)
-
[ENH] - Enable mixing of fixed and traditional prices in the same pricelists.
[ENH] - Add functionality for fixed prices to traditional views.
[FIX] - whitespace and convention issues. - 233. By Ronald Portier (Therp)
-
[FIX] Wrong layout in fixed pricelist version view.
Ronald Portier (Therp) (rportier1962) wrote : | # |
I tried to take most remarks into account. I refer to the commit messages.
Two things
- I prefer having a separate file for each model created or modified. One of the big annoyances in working with the code in OpenERP in my experience is how everything is lumped together in monster .py files. grep is our friend ofcourse. But why for example is res.partner modified somewhere after 1800 (!) lines of code in account_invoice.py? The java community has had the convention of "one class per file" for ages, and that is working out perfectly.
- I did not add an editable list view for the moment. This is just for lack of time. Might add it in the future.
Leonardo Pistone (lepistone) wrote : | # |
Hi all,
my review was just a pointer for Lorenzo because I wanted to see his opinion on this implementation as opposed to his own. I now abstain because I didn't actually review the code.
Thanks to all for your work.
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Hi, Ronald, let me then work in my solution and I'll propose it here. Until them, I'll put this on 'Needs fixing' until then.
Regards.
Ronald Portier (Therp) (rportier1962) wrote : | # |
@Pedro I do not quite understand why you put 'need fixing'. As far as I understand, the module now does everything you and others asked for. OK, I make fields read-only instead of completely hiding them. But what else would you like to be different?
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote : | # |
Dear Ronald Portier,
Thanks for your work. I tested them and functionally they look just fine.
The UI could be simpler: you could make the fields "hidden" instead of "read-only" when a pricelist lines have a fixed price.
Then the additional menu entries and views wouldn't be needed, you could remove them altogether.
Regarding the many files, usually we group them by module so you could do with a "product.py" with all things product-related. But I'd not block this MP for such a detail.
And other that that it looks just fine to me.
Pedro Manuel Baeza, I humbly think we should accept this MP, and then you can base your own branch on Ronald Portier's work. What do you think?
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote : | # |
Pedro Manuel Baeza,
I think I didn't understand your counter-proposal at first, sorry.
What you're proposing may be more powerful but will be more intrusive won't it? Then it might be harder to test. Do you expect to develop advanced price list customizations beyond fixed price in the short term?
Otherwise I think we should accept this and eventually replace it with more complex code like the one you propose, when the actual need arises.
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Hi, I have make another MP proposing my approach for this task. Please review it and tell me if you see it more idoneous:
Regards.
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
I'll disapprove it as https:/
Ronald would be great if you could have a look at Pedro's MP as well.
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
Hi Ronald,
The alternative [0] proposed by Pedro is about to be merged; it has been approved by 3 people. Can we have your opinion on that, and eventually can you close your one if you think that Pedro's proposal fit with your needs as well?
Thanks.
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
Ronald having approved Pedro's proposal, I set the merge status of this proposal as rejected. Thanks to everyone for your work.
Unmerged revisions
- 233. By Ronald Portier (Therp)
-
[FIX] Wrong layout in fixed pricelist version view.
- 232. By Ronald Portier (Therp)
-
[ENH] - Enable mixing of fixed and traditional prices in the same pricelists.
[ENH] - Add functionality for fixed prices to traditional views.
[FIX] - whitespace and convention issues. - 231. By Ronald Portier (Therp)
-
[FIX] Completely replace fixed pricelist module to make it compatible
with OpenERP 7.0, but also have it use just standard computations.
Preview Diff
1 | === modified file 'product_pricelist_fixed_price/AUTHORS.txt' | |||
2 | --- product_pricelist_fixed_price/AUTHORS.txt 2011-04-01 10:14:05 +0000 | |||
3 | +++ product_pricelist_fixed_price/AUTHORS.txt 2014-02-03 14:58:49 +0000 | |||
4 | @@ -1,1 +1,3 @@ | |||
5 | 1 | Lorenzo Battistini <lorenzo.battistini@domsense.com> | 1 | Lorenzo Battistini <lorenzo.battistini@domsense.com> |
6 | 2 | Ronald Portier <ronald@therp.nl> | ||
7 | 3 | |||
8 | 2 | 4 | ||
9 | === modified file 'product_pricelist_fixed_price/__init__.py' | |||
10 | --- product_pricelist_fixed_price/__init__.py 2011-04-01 10:14:05 +0000 | |||
11 | +++ product_pricelist_fixed_price/__init__.py 2014-02-03 14:58:49 +0000 | |||
12 | @@ -1,22 +1,3 @@ | |||
13 | 1 | # -*- encoding: utf-8 -*- | 1 | # -*- encoding: utf-8 -*- |
33 | 2 | ############################################################################## | 2 | from . import model |
15 | 3 | # | ||
16 | 4 | # OpenERP, Open Source Management Solution | ||
17 | 5 | # Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>). | ||
18 | 6 | # | ||
19 | 7 | # This program is free software: you can redistribute it and/or modify | ||
20 | 8 | # it under the terms of the GNU Affero General Public License as | ||
21 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
22 | 10 | # License, or (at your option) any later version. | ||
23 | 11 | # | ||
24 | 12 | # This program is distributed in the hope that it will be useful, | ||
25 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
26 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
27 | 15 | # GNU Affero General Public License for more details. | ||
28 | 16 | # | ||
29 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
30 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
31 | 19 | # | ||
32 | 20 | ############################################################################## | ||
34 | 21 | 3 | ||
35 | 22 | import pricelist | ||
36 | 23 | 4 | ||
37 | === modified file 'product_pricelist_fixed_price/__openerp__.py' | |||
38 | --- product_pricelist_fixed_price/__openerp__.py 2013-01-21 06:49:06 +0000 | |||
39 | +++ product_pricelist_fixed_price/__openerp__.py 2014-02-03 14:58:49 +0000 | |||
40 | @@ -3,6 +3,7 @@ | |||
41 | 3 | # | 3 | # |
42 | 4 | # OpenERP, Open Source Management Solution | 4 | # OpenERP, Open Source Management Solution |
43 | 5 | # Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>). | 5 | # Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>). |
44 | 6 | # 2014 Therp BV (<http://www.therp.nl>). | ||
45 | 6 | # | 7 | # |
46 | 7 | # This program is free software: you can redistribute it and/or modify | 8 | # This program is free software: you can redistribute it and/or modify |
47 | 8 | # it under the terms of the GNU Affero General Public License as | 9 | # it under the terms of the GNU Affero General Public License as |
48 | @@ -19,20 +20,21 @@ | |||
49 | 19 | # | 20 | # |
50 | 20 | ############################################################################## | 21 | ############################################################################## |
51 | 21 | 22 | ||
52 | 22 | |||
53 | 23 | { | 23 | { |
54 | 24 | "name": "Price List Fixed Price", | 24 | "name": "Price List Fixed Price", |
56 | 25 | "version": "1.0", | 25 | "version": "2.0", |
57 | 26 | 'category': 'Generic Modules/Inventory Control', | 26 | 'category': 'Generic Modules/Inventory Control', |
58 | 27 | "depends": ["product"], | 27 | "depends": ["product"], |
65 | 28 | "author": "Agile Business Group & Domsense", | 28 | "author": "Product Addons Community", |
66 | 29 | "description": """This module allows to specify a fixed price for price list rules. So, if the rule is based on 'fixed price', this price will be used without any computation""", | 29 | "description": """This module allows to specify a fixed price for price |
67 | 30 | 'website': 'http://www.agilebg.com', | 30 | list rules.""", |
68 | 31 | 'init_xml': [], | 31 | 'website': 'https://launchpad.net/openerp-product-attributes', |
69 | 32 | 'update_xml': [ | 32 | 'data': [ |
70 | 33 | 'pricelist_view.xml', | 33 | 'view/pricelist_view.xml', |
71 | 34 | 'view/pricelist_menu.xml', | ||
72 | 34 | ], | 35 | ], |
73 | 35 | 'demo_xml': [], | 36 | 'demo_xml': [], |
75 | 36 | 'installable': False, | 37 | 'installable': True, |
76 | 37 | 'active': False, | 38 | 'active': False, |
77 | 38 | } | 39 | } |
78 | 40 | |||
79 | 39 | 41 | ||
80 | === removed file 'product_pricelist_fixed_price/i18n/ca.po' | |||
81 | --- product_pricelist_fixed_price/i18n/ca.po 2012-12-05 05:42:11 +0000 | |||
82 | +++ product_pricelist_fixed_price/i18n/ca.po 1970-01-01 00:00:00 +0000 | |||
83 | @@ -1,65 +0,0 @@ | |||
84 | 1 | # Catalan translation for openobject-addons | ||
85 | 2 | # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 | ||
86 | 3 | # This file is distributed under the same license as the openobject-addons package. | ||
87 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, 2012. | ||
88 | 5 | # | ||
89 | 6 | msgid "" | ||
90 | 7 | msgstr "" | ||
91 | 8 | "Project-Id-Version: openobject-addons\n" | ||
92 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | ||
93 | 10 | "POT-Creation-Date: 2011-03-25 10:08+0000\n" | ||
94 | 11 | "PO-Revision-Date: 2012-04-18 23:39+0000\n" | ||
95 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
96 | 13 | "Language-Team: Catalan <ca@li.org>\n" | ||
97 | 14 | "MIME-Version: 1.0\n" | ||
98 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | ||
99 | 16 | "Content-Transfer-Encoding: 8bit\n" | ||
100 | 17 | "X-Launchpad-Export-Date: 2012-12-05 05:42+0000\n" | ||
101 | 18 | "X-Generator: Launchpad (build 16335)\n" | ||
102 | 19 | |||
103 | 20 | #. module: product_pricelist_fixed_price | ||
104 | 21 | #: view:product.pricelist.item:0 | ||
105 | 22 | msgid "Max. Margin" | ||
106 | 23 | msgstr "Marge màxim" | ||
107 | 24 | |||
108 | 25 | #. module: product_pricelist_fixed_price | ||
109 | 26 | #: view:product.pricelist.item:0 | ||
110 | 27 | msgid "Min. Margin" | ||
111 | 28 | msgstr "Marge mínim" | ||
112 | 29 | |||
113 | 30 | #. module: product_pricelist_fixed_price | ||
114 | 31 | #: view:product.pricelist.item:0 | ||
115 | 32 | msgid "Rounding Method" | ||
116 | 33 | msgstr "Mètode arrodoniment" | ||
117 | 34 | |||
118 | 35 | #. module: product_pricelist_fixed_price | ||
119 | 36 | #: constraint:product.pricelist.item:0 | ||
120 | 37 | msgid "" | ||
121 | 38 | "Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList " | ||
122 | 39 | "Item!" | ||
123 | 40 | msgstr "" | ||
124 | 41 | "Error! No podeu assignar la tarifa principal com una altre tarifa en un " | ||
125 | 42 | "element de la tarifa." | ||
126 | 43 | |||
127 | 44 | #. module: product_pricelist_fixed_price | ||
128 | 45 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist | ||
129 | 46 | msgid "Pricelist" | ||
130 | 47 | msgstr "Tarifa" | ||
131 | 48 | |||
132 | 49 | #. module: product_pricelist_fixed_price | ||
133 | 50 | #: code:addons/product_pricelist_fixed_price/pricelist.py:97 | ||
134 | 51 | #, python-format | ||
135 | 52 | msgid "Warning !" | ||
136 | 53 | msgstr "Atenció!" | ||
137 | 54 | |||
138 | 55 | #. module: product_pricelist_fixed_price | ||
139 | 56 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_item | ||
140 | 57 | msgid "Pricelist item" | ||
141 | 58 | msgstr "Element de la tarifa" | ||
142 | 59 | |||
143 | 60 | #. module: product_pricelist_fixed_price | ||
144 | 61 | #: code:addons/product_pricelist_fixed_price/pricelist.py:32 | ||
145 | 62 | #: field:product.pricelist.item,fixed_price:0 | ||
146 | 63 | #, python-format | ||
147 | 64 | msgid "Fixed Price" | ||
148 | 65 | msgstr "Preu fix" | ||
149 | 66 | 0 | ||
150 | === removed file 'product_pricelist_fixed_price/i18n/de.po' | |||
151 | --- product_pricelist_fixed_price/i18n/de.po 2012-12-05 05:42:11 +0000 | |||
152 | +++ product_pricelist_fixed_price/i18n/de.po 1970-01-01 00:00:00 +0000 | |||
153 | @@ -1,65 +0,0 @@ | |||
154 | 1 | # German translation for openobject-addons | ||
155 | 2 | # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 | ||
156 | 3 | # This file is distributed under the same license as the openobject-addons package. | ||
157 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, 2011. | ||
158 | 5 | # | ||
159 | 6 | msgid "" | ||
160 | 7 | msgstr "" | ||
161 | 8 | "Project-Id-Version: openobject-addons\n" | ||
162 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | ||
163 | 10 | "POT-Creation-Date: 2011-03-25 10:08+0000\n" | ||
164 | 11 | "PO-Revision-Date: 2011-05-02 07:47+0000\n" | ||
165 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
166 | 13 | "Language-Team: German <de@li.org>\n" | ||
167 | 14 | "MIME-Version: 1.0\n" | ||
168 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | ||
169 | 16 | "Content-Transfer-Encoding: 8bit\n" | ||
170 | 17 | "X-Launchpad-Export-Date: 2012-12-05 05:42+0000\n" | ||
171 | 18 | "X-Generator: Launchpad (build 16335)\n" | ||
172 | 19 | |||
173 | 20 | #. module: product_pricelist_fixed_price | ||
174 | 21 | #: view:product.pricelist.item:0 | ||
175 | 22 | msgid "Max. Margin" | ||
176 | 23 | msgstr "Max. Spanne" | ||
177 | 24 | |||
178 | 25 | #. module: product_pricelist_fixed_price | ||
179 | 26 | #: view:product.pricelist.item:0 | ||
180 | 27 | msgid "Min. Margin" | ||
181 | 28 | msgstr "Min. Spanne" | ||
182 | 29 | |||
183 | 30 | #. module: product_pricelist_fixed_price | ||
184 | 31 | #: view:product.pricelist.item:0 | ||
185 | 32 | msgid "Rounding Method" | ||
186 | 33 | msgstr "Rundungsverfahren" | ||
187 | 34 | |||
188 | 35 | #. module: product_pricelist_fixed_price | ||
189 | 36 | #: constraint:product.pricelist.item:0 | ||
190 | 37 | msgid "" | ||
191 | 38 | "Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList " | ||
192 | 39 | "Item!" | ||
193 | 40 | msgstr "" | ||
194 | 41 | "Fehler! Sie können die Basispreisliste nicht als alternative Preisliste in " | ||
195 | 42 | "einem Preislisteneintrag zuweisen." | ||
196 | 43 | |||
197 | 44 | #. module: product_pricelist_fixed_price | ||
198 | 45 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist | ||
199 | 46 | msgid "Pricelist" | ||
200 | 47 | msgstr "Preisliste" | ||
201 | 48 | |||
202 | 49 | #. module: product_pricelist_fixed_price | ||
203 | 50 | #: code:addons/product_pricelist_fixed_price/pricelist.py:97 | ||
204 | 51 | #, python-format | ||
205 | 52 | msgid "Warning !" | ||
206 | 53 | msgstr "Warnung!" | ||
207 | 54 | |||
208 | 55 | #. module: product_pricelist_fixed_price | ||
209 | 56 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_item | ||
210 | 57 | msgid "Pricelist item" | ||
211 | 58 | msgstr "Preisliste Einzelposition" | ||
212 | 59 | |||
213 | 60 | #. module: product_pricelist_fixed_price | ||
214 | 61 | #: code:addons/product_pricelist_fixed_price/pricelist.py:32 | ||
215 | 62 | #: field:product.pricelist.item,fixed_price:0 | ||
216 | 63 | #, python-format | ||
217 | 64 | msgid "Fixed Price" | ||
218 | 65 | msgstr "Festpreis" | ||
219 | 66 | 0 | ||
220 | === removed file 'product_pricelist_fixed_price/i18n/es.po' | |||
221 | --- product_pricelist_fixed_price/i18n/es.po 2012-12-05 05:42:11 +0000 | |||
222 | +++ product_pricelist_fixed_price/i18n/es.po 1970-01-01 00:00:00 +0000 | |||
223 | @@ -1,65 +0,0 @@ | |||
224 | 1 | # Spanish translation for openobject-addons | ||
225 | 2 | # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 | ||
226 | 3 | # This file is distributed under the same license as the openobject-addons package. | ||
227 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, 2011. | ||
228 | 5 | # | ||
229 | 6 | msgid "" | ||
230 | 7 | msgstr "" | ||
231 | 8 | "Project-Id-Version: openobject-addons\n" | ||
232 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | ||
233 | 10 | "POT-Creation-Date: 2011-03-25 10:08+0000\n" | ||
234 | 11 | "PO-Revision-Date: 2011-08-26 23:18+0000\n" | ||
235 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
236 | 13 | "Language-Team: Spanish <es@li.org>\n" | ||
237 | 14 | "MIME-Version: 1.0\n" | ||
238 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | ||
239 | 16 | "Content-Transfer-Encoding: 8bit\n" | ||
240 | 17 | "X-Launchpad-Export-Date: 2012-12-05 05:42+0000\n" | ||
241 | 18 | "X-Generator: Launchpad (build 16335)\n" | ||
242 | 19 | |||
243 | 20 | #. module: product_pricelist_fixed_price | ||
244 | 21 | #: view:product.pricelist.item:0 | ||
245 | 22 | msgid "Max. Margin" | ||
246 | 23 | msgstr "Margen máximo" | ||
247 | 24 | |||
248 | 25 | #. module: product_pricelist_fixed_price | ||
249 | 26 | #: view:product.pricelist.item:0 | ||
250 | 27 | msgid "Min. Margin" | ||
251 | 28 | msgstr "Margen mínimo" | ||
252 | 29 | |||
253 | 30 | #. module: product_pricelist_fixed_price | ||
254 | 31 | #: view:product.pricelist.item:0 | ||
255 | 32 | msgid "Rounding Method" | ||
256 | 33 | msgstr "Método redondeo" | ||
257 | 34 | |||
258 | 35 | #. module: product_pricelist_fixed_price | ||
259 | 36 | #: constraint:product.pricelist.item:0 | ||
260 | 37 | msgid "" | ||
261 | 38 | "Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList " | ||
262 | 39 | "Item!" | ||
263 | 40 | msgstr "" | ||
264 | 41 | "¡Error! No puede asignar la tarifa principal como otra tarifa en un " | ||
265 | 42 | "elemento de la tarifa." | ||
266 | 43 | |||
267 | 44 | #. module: product_pricelist_fixed_price | ||
268 | 45 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist | ||
269 | 46 | msgid "Pricelist" | ||
270 | 47 | msgstr "Lista de Precios" | ||
271 | 48 | |||
272 | 49 | #. module: product_pricelist_fixed_price | ||
273 | 50 | #: code:addons/product_pricelist_fixed_price/pricelist.py:97 | ||
274 | 51 | #, python-format | ||
275 | 52 | msgid "Warning !" | ||
276 | 53 | msgstr "¡Atención!" | ||
277 | 54 | |||
278 | 55 | #. module: product_pricelist_fixed_price | ||
279 | 56 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_item | ||
280 | 57 | msgid "Pricelist item" | ||
281 | 58 | msgstr "Elemento de la tarifa" | ||
282 | 59 | |||
283 | 60 | #. module: product_pricelist_fixed_price | ||
284 | 61 | #: code:addons/product_pricelist_fixed_price/pricelist.py:32 | ||
285 | 62 | #: field:product.pricelist.item,fixed_price:0 | ||
286 | 63 | #, python-format | ||
287 | 64 | msgid "Fixed Price" | ||
288 | 65 | msgstr "Precio fijo" | ||
289 | 66 | 0 | ||
290 | === removed file 'product_pricelist_fixed_price/i18n/it.po' | |||
291 | --- product_pricelist_fixed_price/i18n/it.po 2012-12-05 05:42:11 +0000 | |||
292 | +++ product_pricelist_fixed_price/i18n/it.po 1970-01-01 00:00:00 +0000 | |||
293 | @@ -1,64 +0,0 @@ | |||
294 | 1 | # Translation of OpenERP Server. | ||
295 | 2 | # This file contains the translation of the following modules: | ||
296 | 3 | # * product_pricelist_fixed_price | ||
297 | 4 | # | ||
298 | 5 | msgid "" | ||
299 | 6 | msgstr "" | ||
300 | 7 | "Project-Id-Version: OpenERP Server 6.0.1\n" | ||
301 | 8 | "Report-Msgid-Bugs-To: support@openerp.com\n" | ||
302 | 9 | "POT-Creation-Date: 2011-03-25 10:08+0000\n" | ||
303 | 10 | "PO-Revision-Date: 2011-03-31 12:02+0000\n" | ||
304 | 11 | "Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n" | ||
305 | 12 | "Language-Team: \n" | ||
306 | 13 | "MIME-Version: 1.0\n" | ||
307 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
308 | 15 | "Content-Transfer-Encoding: 8bit\n" | ||
309 | 16 | "X-Launchpad-Export-Date: 2012-12-05 05:42+0000\n" | ||
310 | 17 | "X-Generator: Launchpad (build 16335)\n" | ||
311 | 18 | |||
312 | 19 | #. module: product_pricelist_fixed_price | ||
313 | 20 | #: view:product.pricelist.item:0 | ||
314 | 21 | msgid "Max. Margin" | ||
315 | 22 | msgstr "Margine Massimo" | ||
316 | 23 | |||
317 | 24 | #. module: product_pricelist_fixed_price | ||
318 | 25 | #: view:product.pricelist.item:0 | ||
319 | 26 | msgid "Min. Margin" | ||
320 | 27 | msgstr "Margine Minimo" | ||
321 | 28 | |||
322 | 29 | #. module: product_pricelist_fixed_price | ||
323 | 30 | #: view:product.pricelist.item:0 | ||
324 | 31 | msgid "Rounding Method" | ||
325 | 32 | msgstr "Metodo Arrotondamento" | ||
326 | 33 | |||
327 | 34 | #. module: product_pricelist_fixed_price | ||
328 | 35 | #: constraint:product.pricelist.item:0 | ||
329 | 36 | msgid "" | ||
330 | 37 | "Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList " | ||
331 | 38 | "Item!" | ||
332 | 39 | msgstr "" | ||
333 | 40 | "Errore ! Non è possibile assegnare il listino principale come 'altro " | ||
334 | 41 | "listino' nell'elemento di listino!" | ||
335 | 42 | |||
336 | 43 | #. module: product_pricelist_fixed_price | ||
337 | 44 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist | ||
338 | 45 | msgid "Pricelist" | ||
339 | 46 | msgstr "Listino Prezzi" | ||
340 | 47 | |||
341 | 48 | #. module: product_pricelist_fixed_price | ||
342 | 49 | #: code:addons/product_pricelist_fixed_price/pricelist.py:97 | ||
343 | 50 | #, python-format | ||
344 | 51 | msgid "Warning !" | ||
345 | 52 | msgstr "attenzione !" | ||
346 | 53 | |||
347 | 54 | #. module: product_pricelist_fixed_price | ||
348 | 55 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_item | ||
349 | 56 | msgid "Pricelist item" | ||
350 | 57 | msgstr "Oggetto Listino" | ||
351 | 58 | |||
352 | 59 | #. module: product_pricelist_fixed_price | ||
353 | 60 | #: code:addons/product_pricelist_fixed_price/pricelist.py:32 | ||
354 | 61 | #: field:product.pricelist.item,fixed_price:0 | ||
355 | 62 | #, python-format | ||
356 | 63 | msgid "Fixed Price" | ||
357 | 64 | msgstr "Prezzo fisso" | ||
358 | 65 | 0 | ||
359 | === added file 'product_pricelist_fixed_price/i18n/nl.po' | |||
360 | --- product_pricelist_fixed_price/i18n/nl.po 1970-01-01 00:00:00 +0000 | |||
361 | +++ product_pricelist_fixed_price/i18n/nl.po 2014-02-03 14:58:49 +0000 | |||
362 | @@ -0,0 +1,175 @@ | |||
363 | 1 | # Translation of OpenERP Server. | ||
364 | 2 | # This file contains the translation of the following modules: | ||
365 | 3 | # * product_pricelist_fixed_price | ||
366 | 4 | # <ronald@therp.nl> <>, 2014. | ||
367 | 5 | # | ||
368 | 6 | msgid "" | ||
369 | 7 | msgstr "" | ||
370 | 8 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
371 | 9 | "Report-Msgid-Bugs-To: \n" | ||
372 | 10 | "POT-Creation-Date: 2014-01-27 14:11+0000\n" | ||
373 | 11 | "PO-Revision-Date: 2014-01-27 15:37+0100\n" | ||
374 | 12 | "Last-Translator: <ronald@therp.nl>\n" | ||
375 | 13 | "Language-Team:\n" | ||
376 | 14 | "Language: nl_NL\n" | ||
377 | 15 | "MIME-Version: 1.0\n" | ||
378 | 16 | "Content-Type: text/plain; charset=UTF-8\n" | ||
379 | 17 | "Content-Transfer-Encoding: \n" | ||
380 | 18 | "Plural-Forms: \n" | ||
381 | 19 | "X-Generator: Gtranslator 2.91.6\n" | ||
382 | 20 | |||
383 | 21 | #. module: product_pricelist_fixed_price | ||
384 | 22 | #: model:ir.actions.act_window,help:product_pricelist_fixed_price.product_fixedprice_version_action | ||
385 | 23 | msgid "" | ||
386 | 24 | "<p class=\"oe_view_nocontent_create\">\n" | ||
387 | 25 | " Click to add a pricelist version.\n" | ||
388 | 26 | " </p><p>\n" | ||
389 | 27 | " There can be more than one version of a pricelist, each of\n" | ||
390 | 28 | " these must be valid during a certain period of time. Some\n" | ||
391 | 29 | " examples of versions: Main Prices, 2010, 2011, Summer " | ||
392 | 30 | "Sales,\n" | ||
393 | 31 | " etc.\n" | ||
394 | 32 | " </p>\n" | ||
395 | 33 | " " | ||
396 | 34 | msgstr "" | ||
397 | 35 | "<p class=\"oe_view_nocontent_create\">\n" | ||
398 | 36 | " Klik om een prijslijst versie toe te voegen.\n" | ||
399 | 37 | " </p><p>\n" | ||
400 | 38 | " Er kan meer dan één versie van een prijslijst zijn. Ieder\n" | ||
401 | 39 | " daarvan moet een bepaalde tijd geldig zijn. Voorbeelden van\n" | ||
402 | 40 | " versies: Standaard prijzen, 2010, 2011, Zomer-uitverkoop, " | ||
403 | 41 | "etc.\n" | ||
404 | 42 | " </p>\n" | ||
405 | 43 | "..............." | ||
406 | 44 | |||
407 | 45 | #. module: product_pricelist_fixed_price | ||
408 | 46 | #: model:ir.actions.act_window,help:product_pricelist_fixed_price.product_fixedprice_action | ||
409 | 47 | msgid "" | ||
410 | 48 | "<p class=\"oe_view_nocontent_create\">\n" | ||
411 | 49 | " Click to add a pricelist.\n" | ||
412 | 50 | " </p><p>\n" | ||
413 | 51 | " There can be more than one version of a pricelist, each of\n" | ||
414 | 52 | " these must be valid during a certain period of time. Some\n" | ||
415 | 53 | " examples of versions: Main Prices, 2010, 2011, Summer " | ||
416 | 54 | "Sales,\n" | ||
417 | 55 | " etc.\n" | ||
418 | 56 | " </p>\n" | ||
419 | 57 | " " | ||
420 | 58 | msgstr "" | ||
421 | 59 | "<p class=\"oe_view_nocontent_create\">\n" | ||
422 | 60 | " Klik om een prijslijst toe te voegen.\n" | ||
423 | 61 | " </p><p>\n" | ||
424 | 62 | " Er kan meer dan één versie van een prijslijst zijn. Ieder\n" | ||
425 | 63 | " daarvan moet een bepaalde tijd geldig zijn. Voorbeelden van\n" | ||
426 | 64 | " versies: Standaard prijzen, 2010, 2011, Zomer-uitverkoop, " | ||
427 | 65 | "etc.\n" | ||
428 | 66 | " </p>" | ||
429 | 67 | |||
430 | 68 | #. module: product_pricelist_fixed_price | ||
431 | 69 | #: view:product.pricelist.version:0 | ||
432 | 70 | msgid "Fixed Pricelist Version" | ||
433 | 71 | msgstr "Vaste prijslijst versie" | ||
434 | 72 | |||
435 | 73 | #. module: product_pricelist_fixed_price | ||
436 | 74 | #: model:ir.actions.act_window,name:product_pricelist_fixed_price.product_fixedprice_version_action | ||
437 | 75 | #: model:ir.ui.menu,name:product_pricelist_fixed_price.product_fixedprice_version_menu | ||
438 | 76 | msgid "Fixed Pricelist versions" | ||
439 | 77 | msgstr "Vaste prijslijst versies" | ||
440 | 78 | |||
441 | 79 | #. module: product_pricelist_fixed_price | ||
442 | 80 | #: model:ir.actions.act_window,name:product_pricelist_fixed_price.product_fixedprice_action | ||
443 | 81 | #: model:ir.ui.menu,name:product_pricelist_fixed_price.product_fixedprice_menu | ||
444 | 82 | msgid "Fixed Pricelists" | ||
445 | 83 | msgstr "Vaste prijslijsten" | ||
446 | 84 | |||
447 | 85 | #. module: product_pricelist_fixed_price | ||
448 | 86 | #: field:product.pricelist,fixed_price:0 | ||
449 | 87 | #: field:product.pricelist.item,fixed_price:0 | ||
450 | 88 | #: field:product.pricelist.version,fixed_price:0 | ||
451 | 89 | msgid "Fixed price" | ||
452 | 90 | msgstr "Vaste prijs" | ||
453 | 91 | |||
454 | 92 | #. module: product_pricelist_fixed_price | ||
455 | 93 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:80 | ||
456 | 94 | #, python-format | ||
457 | 95 | msgid "Fixed price item only valid on fixed pricelist." | ||
458 | 96 | msgstr "Vaste prijs regel alleen geldig op een vaste prijslijst." | ||
459 | 97 | |||
460 | 98 | #. module: product_pricelist_fixed_price | ||
461 | 99 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:26 | ||
462 | 100 | #, python-format | ||
463 | 101 | msgid "Fixed price version only valid on fixed pricelist." | ||
464 | 102 | msgstr "Vaste prijsversie alleen geldig voor een vaste prijslijst" | ||
465 | 103 | |||
466 | 104 | #. module: product_pricelist_fixed_price | ||
467 | 105 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:73 | ||
468 | 106 | #, python-format | ||
469 | 107 | msgid "Fixed pricelist should have fixed price items." | ||
470 | 108 | msgstr "Vaste prijslijst moet vaste prijs regels hebben." | ||
471 | 109 | |||
472 | 110 | #. module: product_pricelist_fixed_price | ||
473 | 111 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:19 | ||
474 | 112 | #, python-format | ||
475 | 113 | msgid "Fixed pricelist should have fixed price versions." | ||
476 | 114 | msgstr "Vaste prijslijst moet vaste prijs versies hebben." | ||
477 | 115 | |||
478 | 116 | #. module: product_pricelist_fixed_price | ||
479 | 117 | #: view:product.pricelist.item:0 | ||
480 | 118 | msgid "Price" | ||
481 | 119 | msgstr "Prijs" | ||
482 | 120 | |||
483 | 121 | #. module: product_pricelist_fixed_price | ||
484 | 122 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist | ||
485 | 123 | msgid "Pricelist" | ||
486 | 124 | msgstr "Prijslijst" | ||
487 | 125 | |||
488 | 126 | #. module: product_pricelist_fixed_price | ||
489 | 127 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_version | ||
490 | 128 | msgid "Pricelist Version" | ||
491 | 129 | msgstr "Prijslijst versie" | ||
492 | 130 | |||
493 | 131 | #. module: product_pricelist_fixed_price | ||
494 | 132 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_item | ||
495 | 133 | msgid "Pricelist item" | ||
496 | 134 | msgstr "Prijslijst regel" | ||
497 | 135 | |||
498 | 136 | #. module: product_pricelist_fixed_price | ||
499 | 137 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:85 | ||
500 | 138 | #, python-format | ||
501 | 139 | msgid "Product required for fixed price item." | ||
502 | 140 | msgstr "Produkt verplicht op vaste prijs regel" | ||
503 | 141 | |||
504 | 142 | #. module: product_pricelist_fixed_price | ||
505 | 143 | #: view:product.pricelist.item:0 | ||
506 | 144 | msgid "Products Fixed Price Items" | ||
507 | 145 | msgstr "Vaste prijs regels voor producten" | ||
508 | 146 | |||
509 | 147 | #. module: product_pricelist_fixed_price | ||
510 | 148 | #: view:product.pricelist:0 | ||
511 | 149 | msgid "Products Fixed Price List" | ||
512 | 150 | msgstr "Vaste prijslijst voor produkten" | ||
513 | 151 | |||
514 | 152 | #. module: product_pricelist_fixed_price | ||
515 | 153 | #: view:product.pricelist:0 | ||
516 | 154 | msgid "Products Fixed Price Search" | ||
517 | 155 | msgstr "Zoeken in vaste prijzen voor produkten" | ||
518 | 156 | |||
519 | 157 | #. module: product_pricelist_fixed_price | ||
520 | 158 | #: view:product.pricelist:0 | ||
521 | 159 | msgid "Products Price" | ||
522 | 160 | msgstr "Produktprijzen" | ||
523 | 161 | |||
524 | 162 | #. module: product_pricelist_fixed_price | ||
525 | 163 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:72 | ||
526 | 164 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:79 | ||
527 | 165 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:84 | ||
528 | 166 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:18 | ||
529 | 167 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:25 | ||
530 | 168 | #, python-format | ||
531 | 169 | msgid "Validation error!" | ||
532 | 170 | msgstr "Validatie fout!" | ||
533 | 171 | |||
534 | 172 | #. module: product_pricelist_fixed_price | ||
535 | 173 | #: constraint:product.pricelist.item:0 | ||
536 | 174 | msgid "invalid values for fixed price" | ||
537 | 175 | msgstr "Ongeldige waarden voor vaste prijs" | ||
538 | 0 | 176 | ||
539 | === modified file 'product_pricelist_fixed_price/i18n/product_pricelist_fixed_price.pot' | |||
540 | --- product_pricelist_fixed_price/i18n/product_pricelist_fixed_price.pot 2011-04-01 10:14:05 +0000 | |||
541 | +++ product_pricelist_fixed_price/i18n/product_pricelist_fixed_price.pot 2014-02-03 14:58:49 +0000 | |||
542 | @@ -4,10 +4,10 @@ | |||
543 | 4 | # | 4 | # |
544 | 5 | msgid "" | 5 | msgid "" |
545 | 6 | msgstr "" | 6 | msgstr "" |
550 | 7 | "Project-Id-Version: OpenERP Server 6.0.1\n" | 7 | "Project-Id-Version: OpenERP Server 7.0\n" |
551 | 8 | "Report-Msgid-Bugs-To: support@openerp.com\n" | 8 | "Report-Msgid-Bugs-To: \n" |
552 | 9 | "POT-Creation-Date: 2011-03-25 10:08+0000\n" | 9 | "POT-Creation-Date: 2014-01-27 14:11+0000\n" |
553 | 10 | "PO-Revision-Date: 2011-03-25 10:08+0000\n" | 10 | "PO-Revision-Date: 2014-01-27 14:11+0000\n" |
554 | 11 | "Last-Translator: <>\n" | 11 | "Last-Translator: <>\n" |
555 | 12 | "Language-Team: \n" | 12 | "Language-Team: \n" |
556 | 13 | "MIME-Version: 1.0\n" | 13 | "MIME-Version: 1.0\n" |
557 | @@ -16,45 +16,153 @@ | |||
558 | 16 | "Plural-Forms: \n" | 16 | "Plural-Forms: \n" |
559 | 17 | 17 | ||
560 | 18 | #. module: product_pricelist_fixed_price | 18 | #. module: product_pricelist_fixed_price |
579 | 19 | #: view:product.pricelist.item:0 | 19 | #: model:ir.actions.act_window,help:product_pricelist_fixed_price.product_fixedprice_action |
580 | 20 | msgid "Max. Margin" | 20 | msgid "<p class=\"oe_view_nocontent_create\">\n" |
581 | 21 | msgstr "" | 21 | " Click to add a pricelist.\n" |
582 | 22 | 22 | " </p><p>\n" | |
583 | 23 | #. module: product_pricelist_fixed_price | 23 | " There can be more than one version of a pricelist, each of\n" |
584 | 24 | #: view:product.pricelist.item:0 | 24 | " these must be valid during a certain period of time. Some\n" |
585 | 25 | msgid "Min. Margin" | 25 | " examples of versions: Main Prices, 2010, 2011, Summer Sales,\n" |
586 | 26 | msgstr "" | 26 | " etc.\n" |
587 | 27 | 27 | " </p>\n" | |
588 | 28 | #. module: product_pricelist_fixed_price | 28 | " " |
589 | 29 | #: view:product.pricelist.item:0 | 29 | msgstr "<p class=\"oe_view_nocontent_create\">\n" |
590 | 30 | msgid "Rounding Method" | 30 | " Click to add a pricelist.\n" |
591 | 31 | msgstr "" | 31 | " </p><p>\n" |
592 | 32 | 32 | " There can be more than one version of a pricelist, each of\n" | |
593 | 33 | #. module: product_pricelist_fixed_price | 33 | " these must be valid during a certain period of time. Some\n" |
594 | 34 | #: constraint:product.pricelist.item:0 | 34 | " examples of versions: Main Prices, 2010, 2011, Summer Sales,\n" |
595 | 35 | msgid "Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList Item!" | 35 | " etc.\n" |
596 | 36 | msgstr "" | 36 | " </p>\n" |
597 | 37 | " " | ||
598 | 38 | |||
599 | 39 | #. module: product_pricelist_fixed_price | ||
600 | 40 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:80 | ||
601 | 41 | #, python-format | ||
602 | 42 | msgid "Fixed price item only valid on fixed pricelist." | ||
603 | 43 | msgstr "Fixed price item only valid on fixed pricelist." | ||
604 | 44 | |||
605 | 45 | #. module: product_pricelist_fixed_price | ||
606 | 46 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:19 | ||
607 | 47 | #, python-format | ||
608 | 48 | msgid "Fixed pricelist should have fixed price versions." | ||
609 | 49 | msgstr "Fixed pricelist should have fixed price versions." | ||
610 | 50 | |||
611 | 51 | #. module: product_pricelist_fixed_price | ||
612 | 52 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:72 | ||
613 | 53 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:79 | ||
614 | 54 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:84 | ||
615 | 55 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:18 | ||
616 | 56 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:25 | ||
617 | 57 | #, python-format | ||
618 | 58 | msgid "Validation error!" | ||
619 | 59 | msgstr "Validation error!" | ||
620 | 60 | |||
621 | 61 | #. module: product_pricelist_fixed_price | ||
622 | 62 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_version | ||
623 | 63 | msgid "Pricelist Version" | ||
624 | 64 | msgstr "Pricelist Version" | ||
625 | 65 | |||
626 | 66 | #. module: product_pricelist_fixed_price | ||
627 | 67 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_version.py:26 | ||
628 | 68 | #, python-format | ||
629 | 69 | msgid "Fixed price version only valid on fixed pricelist." | ||
630 | 70 | msgstr "Fixed price version only valid on fixed pricelist." | ||
631 | 71 | |||
632 | 72 | #. module: product_pricelist_fixed_price | ||
633 | 73 | #: model:ir.actions.act_window,help:product_pricelist_fixed_price.product_fixedprice_version_action | ||
634 | 74 | msgid "<p class=\"oe_view_nocontent_create\">\n" | ||
635 | 75 | " Click to add a pricelist version.\n" | ||
636 | 76 | " </p><p>\n" | ||
637 | 77 | " There can be more than one version of a pricelist, each of\n" | ||
638 | 78 | " these must be valid during a certain period of time. Some\n" | ||
639 | 79 | " examples of versions: Main Prices, 2010, 2011, Summer Sales,\n" | ||
640 | 80 | " etc.\n" | ||
641 | 81 | " </p>\n" | ||
642 | 82 | " " | ||
643 | 83 | msgstr "<p class=\"oe_view_nocontent_create\">\n" | ||
644 | 84 | " Click to add a pricelist version.\n" | ||
645 | 85 | " </p><p>\n" | ||
646 | 86 | " There can be more than one version of a pricelist, each of\n" | ||
647 | 87 | " these must be valid during a certain period of time. Some\n" | ||
648 | 88 | " examples of versions: Main Prices, 2010, 2011, Summer Sales,\n" | ||
649 | 89 | " etc.\n" | ||
650 | 90 | " </p>\n" | ||
651 | 91 | " " | ||
652 | 92 | |||
653 | 93 | #. module: product_pricelist_fixed_price | ||
654 | 94 | #: view:product.pricelist:0 | ||
655 | 95 | msgid "Products Fixed Price Search" | ||
656 | 96 | msgstr "Products Fixed Price Search" | ||
657 | 97 | |||
658 | 98 | #. module: product_pricelist_fixed_price | ||
659 | 99 | #: view:product.pricelist.version:0 | ||
660 | 100 | msgid "Fixed Pricelist Version" | ||
661 | 101 | msgstr "Fixed Pricelist Version" | ||
662 | 102 | |||
663 | 103 | #. module: product_pricelist_fixed_price | ||
664 | 104 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:85 | ||
665 | 105 | #, python-format | ||
666 | 106 | msgid "Product required for fixed price item." | ||
667 | 107 | msgstr "Product required for fixed price item." | ||
668 | 108 | |||
669 | 109 | #. module: product_pricelist_fixed_price | ||
670 | 110 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_item | ||
671 | 111 | msgid "Pricelist item" | ||
672 | 112 | msgstr "Pricelist item" | ||
673 | 113 | |||
674 | 114 | #. module: product_pricelist_fixed_price | ||
675 | 115 | #: view:product.pricelist.item:0 | ||
676 | 116 | msgid "Products Fixed Price Items" | ||
677 | 117 | msgstr "Products Fixed Price Items" | ||
678 | 118 | |||
679 | 119 | #. module: product_pricelist_fixed_price | ||
680 | 120 | #: view:product.pricelist:0 | ||
681 | 121 | msgid "Products Price" | ||
682 | 122 | msgstr "Products Price" | ||
683 | 123 | |||
684 | 124 | #. module: product_pricelist_fixed_price | ||
685 | 125 | #: model:ir.actions.act_window,name:product_pricelist_fixed_price.product_fixedprice_action | ||
686 | 126 | #: model:ir.ui.menu,name:product_pricelist_fixed_price.product_fixedprice_menu | ||
687 | 127 | msgid "Fixed Pricelists" | ||
688 | 128 | msgstr "Fixed Pricelists" | ||
689 | 129 | |||
690 | 130 | #. module: product_pricelist_fixed_price | ||
691 | 131 | #: view:product.pricelist:0 | ||
692 | 132 | msgid "Products Fixed Price List" | ||
693 | 133 | msgstr "Products Fixed Price List" | ||
694 | 37 | 134 | ||
695 | 38 | #. module: product_pricelist_fixed_price | 135 | #. module: product_pricelist_fixed_price |
696 | 39 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist | 136 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist |
697 | 40 | msgid "Pricelist" | 137 | msgid "Pricelist" |
713 | 41 | msgstr "" | 138 | msgstr "Pricelist" |
714 | 42 | 139 | ||
715 | 43 | #. module: product_pricelist_fixed_price | 140 | #. module: product_pricelist_fixed_price |
716 | 44 | #: code:addons/product_pricelist_fixed_price/pricelist.py:97 | 141 | #: constraint:product.pricelist.item:0 |
717 | 45 | #, python-format | 142 | msgid "invalid values for fixed price" |
718 | 46 | msgid "Warning !" | 143 | msgstr "invalid values for fixed price" |
719 | 47 | msgstr "" | 144 | |
720 | 48 | 145 | #. module: product_pricelist_fixed_price | |
721 | 49 | #. module: product_pricelist_fixed_price | 146 | #: model:ir.actions.act_window,name:product_pricelist_fixed_price.product_fixedprice_version_action |
722 | 50 | #: model:ir.model,name:product_pricelist_fixed_price.model_product_pricelist_item | 147 | #: model:ir.ui.menu,name:product_pricelist_fixed_price.product_fixedprice_version_menu |
723 | 51 | msgid "Pricelist item" | 148 | msgid "Fixed Pricelist versions" |
724 | 52 | msgstr "" | 149 | msgstr "Fixed Pricelist versions" |
725 | 53 | 150 | ||
726 | 54 | #. module: product_pricelist_fixed_price | 151 | #. module: product_pricelist_fixed_price |
727 | 55 | #: code:addons/product_pricelist_fixed_price/pricelist.py:32 | 152 | #: view:product.pricelist.item:0 |
728 | 153 | msgid "Price" | ||
729 | 154 | msgstr "Price" | ||
730 | 155 | |||
731 | 156 | #. module: product_pricelist_fixed_price | ||
732 | 157 | #: field:product.pricelist,fixed_price:0 | ||
733 | 56 | #: field:product.pricelist.item,fixed_price:0 | 158 | #: field:product.pricelist.item,fixed_price:0 |
734 | 159 | #: field:product.pricelist.version,fixed_price:0 | ||
735 | 160 | msgid "Fixed price" | ||
736 | 161 | msgstr "Fixed price" | ||
737 | 162 | |||
738 | 163 | #. module: product_pricelist_fixed_price | ||
739 | 164 | #: code:addons/product_pricelist_fixed_price/model/product_pricelist_item.py:73 | ||
740 | 57 | #, python-format | 165 | #, python-format |
743 | 58 | msgid "Fixed Price" | 166 | msgid "Fixed pricelist should have fixed price items." |
744 | 59 | msgstr "" | 167 | msgstr "Fixed pricelist should have fixed price items." |
745 | 60 | 168 | ||
746 | 61 | 169 | ||
747 | === added directory 'product_pricelist_fixed_price/model' | |||
748 | === added file 'product_pricelist_fixed_price/model/__init__.py' | |||
749 | --- product_pricelist_fixed_price/model/__init__.py 1970-01-01 00:00:00 +0000 | |||
750 | +++ product_pricelist_fixed_price/model/__init__.py 2014-02-03 14:58:49 +0000 | |||
751 | @@ -0,0 +1,5 @@ | |||
752 | 1 | # -*- encoding: utf-8 -*- | ||
753 | 2 | from . import product_pricelist | ||
754 | 3 | from . import product_pricelist_version | ||
755 | 4 | from . import product_pricelist_item | ||
756 | 5 | |||
757 | 0 | 6 | ||
758 | === added file 'product_pricelist_fixed_price/model/product_pricelist.py' | |||
759 | --- product_pricelist_fixed_price/model/product_pricelist.py 1970-01-01 00:00:00 +0000 | |||
760 | +++ product_pricelist_fixed_price/model/product_pricelist.py 2014-02-03 14:58:49 +0000 | |||
761 | @@ -0,0 +1,34 @@ | |||
762 | 1 | #-*- coding: utf-8 -*- | ||
763 | 2 | ############################################################################## | ||
764 | 3 | # | ||
765 | 4 | # OpenERP, Open Source Management Solution | ||
766 | 5 | # Copyright (C) 2014 Therp BV (<http://www.therp.nl>). | ||
767 | 6 | # | ||
768 | 7 | # This program is free software: you can redistribute it and/or modify | ||
769 | 8 | # it under the terms of the GNU Affero General Public License as | ||
770 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
771 | 10 | # License, or (at your option) any later version. | ||
772 | 11 | # | ||
773 | 12 | # This program is distributed in the hope that it will be useful, | ||
774 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
775 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
776 | 15 | # GNU Affero General Public License for more details. | ||
777 | 16 | # | ||
778 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
779 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
780 | 19 | # | ||
781 | 20 | ############################################################################## | ||
782 | 21 | |||
783 | 22 | from openerp.osv import orm, fields | ||
784 | 23 | |||
785 | 24 | |||
786 | 25 | class ProductPricelist(orm.Model): | ||
787 | 26 | _inherit = 'product.pricelist' | ||
788 | 27 | |||
789 | 28 | _columns = { | ||
790 | 29 | 'fixed_price': fields.boolean( | ||
791 | 30 | 'Fixed price', | ||
792 | 31 | help='Pricelist intended for fixed prices.', | ||
793 | 32 | ), | ||
794 | 33 | } | ||
795 | 34 | |||
796 | 0 | 35 | ||
797 | === added file 'product_pricelist_fixed_price/model/product_pricelist_item.py' | |||
798 | --- product_pricelist_fixed_price/model/product_pricelist_item.py 1970-01-01 00:00:00 +0000 | |||
799 | +++ product_pricelist_fixed_price/model/product_pricelist_item.py 2014-02-03 14:58:49 +0000 | |||
800 | @@ -0,0 +1,117 @@ | |||
801 | 1 | #-*- coding: utf-8 -*- | ||
802 | 2 | ############################################################################## | ||
803 | 3 | # | ||
804 | 4 | # OpenERP, Open Source Management Solution | ||
805 | 5 | # Copyright (C) 2014 Therp BV (<http://www.therp.nl>). | ||
806 | 6 | # | ||
807 | 7 | # This program is free software: you can redistribute it and/or modify | ||
808 | 8 | # it under the terms of the GNU Affero General Public License as | ||
809 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
810 | 10 | # License, or (at your option) any later version. | ||
811 | 11 | # | ||
812 | 12 | # This program is distributed in the hope that it will be useful, | ||
813 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
814 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
815 | 15 | # GNU Affero General Public License for more details. | ||
816 | 16 | # | ||
817 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
818 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
819 | 19 | # | ||
820 | 20 | ############################################################################## | ||
821 | 21 | |||
822 | 22 | '''All functionality to enable fixed prices in pricelists.''' | ||
823 | 23 | |||
824 | 24 | from openerp.osv import orm, fields | ||
825 | 25 | from openerp.tools.translate import _ | ||
826 | 26 | |||
827 | 27 | |||
828 | 28 | class ProductPricelistItem(orm.Model): | ||
829 | 29 | '''Inherit existing model to add functionality for fixed prices''' | ||
830 | 30 | _inherit = 'product.pricelist.item' | ||
831 | 31 | |||
832 | 32 | def _modify_vals(self, cr, uid, vals, browse_obj=None, context=None): | ||
833 | 33 | '''Ensure consistent values for fixed pricelists. | ||
834 | 34 | The passed vals parameter is used for both input and output.''' | ||
835 | 35 | # First determine wether a fixed price should apply | ||
836 | 36 | fixed_price = False | ||
837 | 37 | if browse_obj: | ||
838 | 38 | fixed_price = browse_obj.fixed_price | ||
839 | 39 | else: | ||
840 | 40 | # new record | ||
841 | 41 | fixed_price = ( | ||
842 | 42 | ('fixed_price' in vals and vals['fixed_price']) or | ||
843 | 43 | ('default_fixed_price' in vals | ||
844 | 44 | and vals['default_fixed_price']) or | ||
845 | 45 | False | ||
846 | 46 | ) | ||
847 | 47 | if not fixed_price: | ||
848 | 48 | return | ||
849 | 49 | # If we get here, we have a fixed price, because we need some | ||
850 | 50 | # reference to a price in product (even though its influence will be | ||
851 | 51 | # eliminated by our price_discount), we use the standard price | ||
852 | 52 | model_model = self.pool.get('ir.model.data') | ||
853 | 53 | standard_price_type = model_model.get_object_reference( | ||
854 | 54 | cr, uid, 'product', 'standard_price')[1] | ||
855 | 55 | vals.update({ | ||
856 | 56 | 'price_discount': -1.0, | ||
857 | 57 | 'price_round': 0.0, | ||
858 | 58 | 'base': standard_price_type, | ||
859 | 59 | 'price_min_margin': 0.0, | ||
860 | 60 | 'price_max_margin': 0.0, | ||
861 | 61 | }) | ||
862 | 62 | |||
863 | 63 | def create(self, cr, uid, vals, context=None): | ||
864 | 64 | '''Make sure fixed pricelist items have consistent values''' | ||
865 | 65 | self._modify_vals(cr, uid, vals, browse_obj=None, context=context) | ||
866 | 66 | return super(ProductPricelistItem, self).create( | ||
867 | 67 | cr, uid, vals, context) | ||
868 | 68 | |||
869 | 69 | def write(self, cr, uid, ids, vals, context=None): | ||
870 | 70 | '''Override write method. We have to take into account that | ||
871 | 71 | we only get one set of values, but that the change might effect | ||
872 | 72 | multiple ids. But because the computations we do might be different | ||
873 | 73 | depending on the current values in the database, we will setup a loop | ||
874 | 74 | and compute and update each record separately. | ||
875 | 75 | ''' | ||
876 | 76 | for item_id in ids: | ||
877 | 77 | browse_records = self.browse(cr, uid, [item_id], context=context) | ||
878 | 78 | browse_obj = browse_records[0] | ||
879 | 79 | self._modify_vals( | ||
880 | 80 | cr, uid, vals, browse_obj=browse_obj, context=context) | ||
881 | 81 | super(ProductPricelistItem, self).write( | ||
882 | 82 | cr, uid, [item_id], vals, context=context) | ||
883 | 83 | return True | ||
884 | 84 | |||
885 | 85 | def onchange_fixed_price( | ||
886 | 86 | self, cr, uid, ids, fixed_price, context=None): | ||
887 | 87 | res = {} | ||
888 | 88 | if fixed_price: | ||
889 | 89 | vals = {'fixed_price': True} | ||
890 | 90 | self._modify_vals(cr, uid, vals, context=context) | ||
891 | 91 | res['value'] = vals | ||
892 | 92 | return res | ||
893 | 93 | |||
894 | 94 | _columns = { | ||
895 | 95 | 'fixed_price': fields.boolean('Fixed price'), | ||
896 | 96 | } | ||
897 | 97 | |||
898 | 98 | def _check_fixed_price(self, cr, uid, ids): | ||
899 | 99 | '''Ensure fixed prices always refer to a specific product.''' | ||
900 | 100 | for this_obj in self.browse(cr, uid, ids): | ||
901 | 101 | if not this_obj.fixed_price: | ||
902 | 102 | return True | ||
903 | 103 | if not this_obj.product_id: | ||
904 | 104 | raise orm.except_orm( | ||
905 | 105 | _('Validation error!'), | ||
906 | 106 | _('Product required for fixed price item.') | ||
907 | 107 | ) | ||
908 | 108 | # Values for price_discount and price_round will not be checked, | ||
909 | 109 | # because create and write will automagically set appropiate | ||
910 | 110 | # values. | ||
911 | 111 | return True | ||
912 | 112 | |||
913 | 113 | _constraints = [ | ||
914 | 114 | (_check_fixed_price, | ||
915 | 115 | 'invalid values for fixed price', ['fixed_price']), | ||
916 | 116 | ] | ||
917 | 117 | |||
918 | 0 | 118 | ||
919 | === added file 'product_pricelist_fixed_price/model/product_pricelist_version.py' | |||
920 | --- product_pricelist_fixed_price/model/product_pricelist_version.py 1970-01-01 00:00:00 +0000 | |||
921 | +++ product_pricelist_fixed_price/model/product_pricelist_version.py 2014-02-03 14:58:49 +0000 | |||
922 | @@ -0,0 +1,35 @@ | |||
923 | 1 | #-*- coding: utf-8 -*- | ||
924 | 2 | ############################################################################## | ||
925 | 3 | # | ||
926 | 4 | # OpenERP, Open Source Management Solution | ||
927 | 5 | # Copyright (C) 2014 Therp BV (<http://www.therp.nl>). | ||
928 | 6 | # | ||
929 | 7 | # This program is free software: you can redistribute it and/or modify | ||
930 | 8 | # it under the terms of the GNU Affero General Public License as | ||
931 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
932 | 10 | # License, or (at your option) any later version. | ||
933 | 11 | # | ||
934 | 12 | # This program is distributed in the hope that it will be useful, | ||
935 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
936 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
937 | 15 | # GNU Affero General Public License for more details. | ||
938 | 16 | # | ||
939 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
940 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
941 | 19 | # | ||
942 | 20 | ############################################################################## | ||
943 | 21 | |||
944 | 22 | from openerp.osv import orm, fields | ||
945 | 23 | from openerp.tools.translate import _ | ||
946 | 24 | |||
947 | 25 | |||
948 | 26 | class ProductPricelistVersion(orm.Model): | ||
949 | 27 | _inherit = 'product.pricelist.version' | ||
950 | 28 | |||
951 | 29 | _columns = { | ||
952 | 30 | 'fixed_price': fields.boolean( | ||
953 | 31 | 'Fixed price', | ||
954 | 32 | help='Pricelist intended for fixed prices.', | ||
955 | 33 | ), | ||
956 | 34 | } | ||
957 | 35 | |||
958 | 0 | 36 | ||
959 | === removed file 'product_pricelist_fixed_price/pricelist.py' | |||
960 | --- product_pricelist_fixed_price/pricelist.py 2011-04-01 10:14:05 +0000 | |||
961 | +++ product_pricelist_fixed_price/pricelist.py 1970-01-01 00:00:00 +0000 | |||
962 | @@ -1,211 +0,0 @@ | |||
963 | 1 | # -*- encoding: utf-8 -*- | ||
964 | 2 | ############################################################################## | ||
965 | 3 | # | ||
966 | 4 | # OpenERP, Open Source Management Solution | ||
967 | 5 | # Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>). | ||
968 | 6 | # | ||
969 | 7 | # This program is free software: you can redistribute it and/or modify | ||
970 | 8 | # it under the terms of the GNU Affero General Public License as | ||
971 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
972 | 10 | # License, or (at your option) any later version. | ||
973 | 11 | # | ||
974 | 12 | # This program is distributed in the hope that it will be useful, | ||
975 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
976 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
977 | 15 | # GNU Affero General Public License for more details. | ||
978 | 16 | # | ||
979 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
980 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
981 | 19 | # | ||
982 | 20 | ############################################################################## | ||
983 | 21 | |||
984 | 22 | from osv import fields,osv | ||
985 | 23 | from tools.translate import _ | ||
986 | 24 | import decimal_precision as dp | ||
987 | 25 | import time | ||
988 | 26 | from product._common import rounding | ||
989 | 27 | |||
990 | 28 | class product_pricelist_item(osv.osv): | ||
991 | 29 | |||
992 | 30 | def _price_field_get(self, cr, uid, context=None): | ||
993 | 31 | result = super(product_pricelist_item, self)._price_field_get(cr, uid, context) | ||
994 | 32 | result.append((-3, _('Fixed Price'))) | ||
995 | 33 | return result | ||
996 | 34 | |||
997 | 35 | _inherit = "product.pricelist.item" | ||
998 | 36 | |||
999 | 37 | _columns = { | ||
1000 | 38 | 'fixed_price': fields.float('Fixed Price', | ||
1001 | 39 | digits_compute= dp.get_precision('Sale Price')), | ||
1002 | 40 | 'base': fields.selection(_price_field_get, 'Based on', required=True, size=-1, help="The mode for computing the price for this rule."), | ||
1003 | 41 | } | ||
1004 | 42 | |||
1005 | 43 | product_pricelist_item() | ||
1006 | 44 | |||
1007 | 45 | class product_pricelist(osv.osv): | ||
1008 | 46 | _inherit = "product.pricelist" | ||
1009 | 47 | |||
1010 | 48 | def price_get_multi(self, cr, uid, pricelist_ids, products_by_qty_by_partner, context=None): | ||
1011 | 49 | |||
1012 | 50 | def _create_parent_category_list(id, lst): | ||
1013 | 51 | if not id: | ||
1014 | 52 | return [] | ||
1015 | 53 | parent = product_category_tree.get(id) | ||
1016 | 54 | if parent: | ||
1017 | 55 | lst.append(parent) | ||
1018 | 56 | return _create_parent_category_list(parent, lst) | ||
1019 | 57 | else: | ||
1020 | 58 | return lst | ||
1021 | 59 | # _create_parent_category_list | ||
1022 | 60 | |||
1023 | 61 | if context is None: | ||
1024 | 62 | context = {} | ||
1025 | 63 | |||
1026 | 64 | date = time.strftime('%Y-%m-%d') | ||
1027 | 65 | if 'date' in context: | ||
1028 | 66 | date = context['date'] | ||
1029 | 67 | |||
1030 | 68 | currency_obj = self.pool.get('res.currency') | ||
1031 | 69 | product_obj = self.pool.get('product.product') | ||
1032 | 70 | product_category_obj = self.pool.get('product.category') | ||
1033 | 71 | product_uom_obj = self.pool.get('product.uom') | ||
1034 | 72 | supplierinfo_obj = self.pool.get('product.supplierinfo') | ||
1035 | 73 | price_type_obj = self.pool.get('product.price.type') | ||
1036 | 74 | product_pricelist_version_obj = self.pool.get('product.pricelist.version') | ||
1037 | 75 | |||
1038 | 76 | # product.pricelist.version: | ||
1039 | 77 | if pricelist_ids: | ||
1040 | 78 | pricelist_version_ids = pricelist_ids | ||
1041 | 79 | else: | ||
1042 | 80 | # all pricelists: | ||
1043 | 81 | pricelist_version_ids = self.pool.get('product.pricelist').search(cr, uid, [], context=context) | ||
1044 | 82 | |||
1045 | 83 | pricelist_version_ids = list(set(pricelist_version_ids)) | ||
1046 | 84 | plversions_search_args = [ | ||
1047 | 85 | ('pricelist_id', 'in', pricelist_version_ids), | ||
1048 | 86 | '|', | ||
1049 | 87 | ('date_start', '=', False), | ||
1050 | 88 | ('date_start', '<=', date), | ||
1051 | 89 | '|', | ||
1052 | 90 | ('date_end', '=', False), | ||
1053 | 91 | ('date_end', '>=', date), | ||
1054 | 92 | ] | ||
1055 | 93 | |||
1056 | 94 | plversion_ids = product_pricelist_version_obj.search(cr, uid, plversions_search_args) | ||
1057 | 95 | if len(pricelist_version_ids) != len(plversion_ids): | ||
1058 | 96 | msg = "At least one pricelist has no active version !\nPlease create or activate one." | ||
1059 | 97 | raise osv.except_osv(_('Warning !'), _(msg)) | ||
1060 | 98 | |||
1061 | 99 | # product.product: | ||
1062 | 100 | product_ids = [i[0] for i in products_by_qty_by_partner] | ||
1063 | 101 | #products = dict([(item['id'], item) for item in product_obj.read(cr, uid, product_ids, ['categ_id', 'product_tmpl_id', 'uos_id', 'uom_id'])]) | ||
1064 | 102 | products = product_obj.browse(cr, uid, product_ids, context=context) | ||
1065 | 103 | products_dict = dict([(item.id, item) for item in products]) | ||
1066 | 104 | |||
1067 | 105 | # product.category: | ||
1068 | 106 | product_category_ids = product_category_obj.search(cr, uid, []) | ||
1069 | 107 | product_categories = product_category_obj.read(cr, uid, product_category_ids, ['parent_id']) | ||
1070 | 108 | product_category_tree = dict([(item['id'], item['parent_id'][0]) for item in product_categories if item['parent_id']]) | ||
1071 | 109 | |||
1072 | 110 | results = {} | ||
1073 | 111 | for product_id, qty, partner in products_by_qty_by_partner: | ||
1074 | 112 | for pricelist_id in pricelist_version_ids: | ||
1075 | 113 | price = False | ||
1076 | 114 | |||
1077 | 115 | tmpl_id = products_dict[product_id].product_tmpl_id and products_dict[product_id].product_tmpl_id.id or False | ||
1078 | 116 | |||
1079 | 117 | categ_id = products_dict[product_id].categ_id and products_dict[product_id].categ_id.id or False | ||
1080 | 118 | categ_ids = _create_parent_category_list(categ_id, [categ_id]) | ||
1081 | 119 | if categ_ids: | ||
1082 | 120 | categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))' | ||
1083 | 121 | else: | ||
1084 | 122 | categ_where = '(categ_id IS NULL)' | ||
1085 | 123 | |||
1086 | 124 | cr.execute( | ||
1087 | 125 | 'SELECT i.*, pl.currency_id ' | ||
1088 | 126 | 'FROM product_pricelist_item AS i, ' | ||
1089 | 127 | 'product_pricelist_version AS v, product_pricelist AS pl ' | ||
1090 | 128 | 'WHERE (product_tmpl_id IS NULL OR product_tmpl_id = %s) ' | ||
1091 | 129 | 'AND (product_id IS NULL OR product_id = %s) ' | ||
1092 | 130 | 'AND (' + categ_where + ' OR (categ_id IS NULL)) ' | ||
1093 | 131 | 'AND price_version_id = %s ' | ||
1094 | 132 | 'AND (min_quantity IS NULL OR min_quantity <= %s) ' | ||
1095 | 133 | 'AND i.price_version_id = v.id AND v.pricelist_id = pl.id ' | ||
1096 | 134 | 'ORDER BY sequence', | ||
1097 | 135 | (tmpl_id, product_id, plversion_ids[0], qty)) | ||
1098 | 136 | res1 = cr.dictfetchall() | ||
1099 | 137 | uom_price_already_computed = False | ||
1100 | 138 | for res in res1: | ||
1101 | 139 | if res: | ||
1102 | 140 | if res['base'] == -1: | ||
1103 | 141 | if not res['base_pricelist_id']: | ||
1104 | 142 | price = 0.0 | ||
1105 | 143 | else: | ||
1106 | 144 | price_tmp = self.price_get(cr, uid, | ||
1107 | 145 | [res['base_pricelist_id']], product_id, | ||
1108 | 146 | qty, context=context)[res['base_pricelist_id']] | ||
1109 | 147 | ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id | ||
1110 | 148 | price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) | ||
1111 | 149 | elif res['base'] == -2: | ||
1112 | 150 | # this section could be improved by moving the queries outside the loop: | ||
1113 | 151 | where = [] | ||
1114 | 152 | if partner: | ||
1115 | 153 | where = [('name', '=', partner) ] | ||
1116 | 154 | sinfo = supplierinfo_obj.search(cr, uid, | ||
1117 | 155 | [('product_id', '=', tmpl_id)] + where) | ||
1118 | 156 | price = 0.0 | ||
1119 | 157 | if sinfo: | ||
1120 | 158 | qty_in_product_uom = qty | ||
1121 | 159 | product_default_uom = product_obj.read(cr, uid, [tmpl_id], ['uom_id'])[0]['uom_id'][0] | ||
1122 | 160 | seller_uom = supplierinfo_obj.read(cr, uid, sinfo, ['product_uom'])[0]['product_uom'][0] | ||
1123 | 161 | if seller_uom and product_default_uom and product_default_uom != seller_uom: | ||
1124 | 162 | uom_price_already_computed = True | ||
1125 | 163 | qty_in_product_uom = product_uom_obj._compute_qty(cr, uid, product_default_uom, qty, to_uom_id=seller_uom) | ||
1126 | 164 | cr.execute('SELECT * ' \ | ||
1127 | 165 | 'FROM pricelist_partnerinfo ' \ | ||
1128 | 166 | 'WHERE suppinfo_id IN %s' \ | ||
1129 | 167 | 'AND min_quantity <= %s ' \ | ||
1130 | 168 | 'ORDER BY min_quantity DESC LIMIT 1', (tuple(sinfo),qty_in_product_uom,)) | ||
1131 | 169 | res2 = cr.dictfetchone() | ||
1132 | 170 | if res2: | ||
1133 | 171 | price = res2['price'] | ||
1134 | 172 | elif res['base'] == -3: | ||
1135 | 173 | price = res['fixed_price'] | ||
1136 | 174 | else: | ||
1137 | 175 | price_type = price_type_obj.browse(cr, uid, int(res['base'])) | ||
1138 | 176 | price = currency_obj.compute(cr, uid, | ||
1139 | 177 | price_type.currency_id.id, res['currency_id'], | ||
1140 | 178 | product_obj.price_get(cr, uid, [product_id], | ||
1141 | 179 | price_type.field,context=context)[product_id], round=False, context=context) | ||
1142 | 180 | |||
1143 | 181 | if price: | ||
1144 | 182 | price_limit = price | ||
1145 | 183 | |||
1146 | 184 | price = price * (1.0+(res['price_discount'] or 0.0)) | ||
1147 | 185 | price = rounding(price, res['price_round']) | ||
1148 | 186 | price += (res['price_surcharge'] or 0.0) | ||
1149 | 187 | if res['price_min_margin']: | ||
1150 | 188 | price = max(price, price_limit+res['price_min_margin']) | ||
1151 | 189 | if res['price_max_margin']: | ||
1152 | 190 | price = min(price, price_limit+res['price_max_margin']) | ||
1153 | 191 | break | ||
1154 | 192 | |||
1155 | 193 | else: | ||
1156 | 194 | # False means no valid line found ! But we may not raise an | ||
1157 | 195 | # exception here because it breaks the search | ||
1158 | 196 | price = False | ||
1159 | 197 | |||
1160 | 198 | if price: | ||
1161 | 199 | if 'uom' in context and not uom_price_already_computed: | ||
1162 | 200 | product = products_dict[product_id] | ||
1163 | 201 | uom = product.uos_id or product.uom_id | ||
1164 | 202 | price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, price, context['uom']) | ||
1165 | 203 | |||
1166 | 204 | if results.get(product_id): | ||
1167 | 205 | results[product_id][pricelist_id] = price | ||
1168 | 206 | else: | ||
1169 | 207 | results[product_id] = {pricelist_id: price} | ||
1170 | 208 | |||
1171 | 209 | return results | ||
1172 | 210 | |||
1173 | 211 | product_pricelist() | ||
1174 | 212 | 0 | ||
1175 | === removed file 'product_pricelist_fixed_price/pricelist_view.xml' | |||
1176 | --- product_pricelist_fixed_price/pricelist_view.xml 2011-04-01 10:14:05 +0000 | |||
1177 | +++ product_pricelist_fixed_price/pricelist_view.xml 1970-01-01 00:00:00 +0000 | |||
1178 | @@ -1,76 +0,0 @@ | |||
1179 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
1180 | 2 | <openerp> | ||
1181 | 3 | <data> | ||
1182 | 4 | <record model="ir.ui.view" id="product_pricelist_item_form_view_fixed"> | ||
1183 | 5 | <field name="name">product.pricelist.item.form.fixed</field> | ||
1184 | 6 | <field name="model">product.pricelist.item</field> | ||
1185 | 7 | <field name="inherit_id" ref="product.product_pricelist_item_form_view"/> | ||
1186 | 8 | <field name="type">form</field> | ||
1187 | 9 | <field name="arch" type="xml"> | ||
1188 | 10 | <field name="price_max_margin" position="after"> | ||
1189 | 11 | <field name="fixed_price" colspan="3" attrs="{'readonly': [('base','!=', -3)]}"/> | ||
1190 | 12 | </field> | ||
1191 | 13 | </field> | ||
1192 | 14 | </record> | ||
1193 | 15 | |||
1194 | 16 | <record model="ir.ui.view" id="product_pricelist_item_form_view_price_discount"> | ||
1195 | 17 | <field name="name">product.pricelist.item.form.price_discount</field> | ||
1196 | 18 | <field name="model">product.pricelist.item</field> | ||
1197 | 19 | <field name="inherit_id" ref="product.product_pricelist_item_form_view"/> | ||
1198 | 20 | <field name="type">form</field> | ||
1199 | 21 | <field name="arch" type="xml"> | ||
1200 | 22 | <field name="price_discount" position="replace"> | ||
1201 | 23 | <field name="price_discount" nolabel="1" attrs="{'readonly': [('base','==', -3)]}"/> | ||
1202 | 24 | </field> | ||
1203 | 25 | </field> | ||
1204 | 26 | </record> | ||
1205 | 27 | |||
1206 | 28 | <record model="ir.ui.view" id="product_pricelist_item_form_view_price_surcharge"> | ||
1207 | 29 | <field name="name">product.pricelist.item.form.price_surcharge</field> | ||
1208 | 30 | <field name="model">product.pricelist.item</field> | ||
1209 | 31 | <field name="inherit_id" ref="product.product_pricelist_item_form_view"/> | ||
1210 | 32 | <field name="type">form</field> | ||
1211 | 33 | <field name="arch" type="xml"> | ||
1212 | 34 | <field name="price_surcharge" position="replace"> | ||
1213 | 35 | <field name="price_surcharge" nolabel="1" attrs="{'readonly': [('base','==', -3)]}"/> | ||
1214 | 36 | </field> | ||
1215 | 37 | </field> | ||
1216 | 38 | </record> | ||
1217 | 39 | |||
1218 | 40 | <record model="ir.ui.view" id="product_pricelist_item_form_view_price_round"> | ||
1219 | 41 | <field name="name">product.pricelist.item.form.price_round</field> | ||
1220 | 42 | <field name="model">product.pricelist.item</field> | ||
1221 | 43 | <field name="inherit_id" ref="product.product_pricelist_item_form_view"/> | ||
1222 | 44 | <field name="type">form</field> | ||
1223 | 45 | <field name="arch" type="xml"> | ||
1224 | 46 | <field name="price_round" position="replace"> | ||
1225 | 47 | <field name="price_round" string="Rounding Method" attrs="{'readonly': [('base','==', -3)]}"/> | ||
1226 | 48 | </field> | ||
1227 | 49 | </field> | ||
1228 | 50 | </record> | ||
1229 | 51 | |||
1230 | 52 | <record model="ir.ui.view" id="product_pricelist_item_form_view_price_min_margin"> | ||
1231 | 53 | <field name="name">product.pricelist.item.form.price_min_margin</field> | ||
1232 | 54 | <field name="model">product.pricelist.item</field> | ||
1233 | 55 | <field name="inherit_id" ref="product.product_pricelist_item_form_view"/> | ||
1234 | 56 | <field name="type">form</field> | ||
1235 | 57 | <field name="arch" type="xml"> | ||
1236 | 58 | <field name="price_min_margin" position="replace"> | ||
1237 | 59 | <field name="price_min_margin" string="Min. Margin" attrs="{'readonly': [('base','==', -3)]}"/> | ||
1238 | 60 | </field> | ||
1239 | 61 | </field> | ||
1240 | 62 | </record> | ||
1241 | 63 | |||
1242 | 64 | <record model="ir.ui.view" id="product_pricelist_item_form_view_price_max_margin"> | ||
1243 | 65 | <field name="name">product.pricelist.item.form.price_max_margin</field> | ||
1244 | 66 | <field name="model">product.pricelist.item</field> | ||
1245 | 67 | <field name="inherit_id" ref="product.product_pricelist_item_form_view"/> | ||
1246 | 68 | <field name="type">form</field> | ||
1247 | 69 | <field name="arch" type="xml"> | ||
1248 | 70 | <field name="price_max_margin" position="replace"> | ||
1249 | 71 | <field name="price_max_margin" string="Max. Margin" attrs="{'readonly': [('base','==', -3)]}"/> | ||
1250 | 72 | </field> | ||
1251 | 73 | </field> | ||
1252 | 74 | </record> | ||
1253 | 75 | </data> | ||
1254 | 76 | </openerp> | ||
1255 | 77 | 0 | ||
1256 | === added directory 'product_pricelist_fixed_price/view' | |||
1257 | === added file 'product_pricelist_fixed_price/view/pricelist_menu.xml' | |||
1258 | --- product_pricelist_fixed_price/view/pricelist_menu.xml 1970-01-01 00:00:00 +0000 | |||
1259 | +++ product_pricelist_fixed_price/view/pricelist_menu.xml 2014-02-03 14:58:49 +0000 | |||
1260 | @@ -0,0 +1,109 @@ | |||
1261 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
1262 | 2 | <openerp> | ||
1263 | 3 | <data> | ||
1264 | 4 | |||
1265 | 5 | <record id="product_fixedprice_action" model="ir.actions.act_window"> | ||
1266 | 6 | <field name="name">Fixed Pricelists</field> | ||
1267 | 7 | <field name="type">ir.actions.act_window</field> | ||
1268 | 8 | <field name="res_model">product.pricelist</field> | ||
1269 | 9 | <field name="view_type">form</field> | ||
1270 | 10 | <field name="domain">[('fixed_price', '=', True)]</field> | ||
1271 | 11 | <field name="context">{'default_fixed_price': True}</field> | ||
1272 | 12 | <field name="view_id" ref="product_fixedprice_tree"/> | ||
1273 | 13 | <field name="help" type="html"> | ||
1274 | 14 | <p class="oe_view_nocontent_create"> | ||
1275 | 15 | Click to add a pricelist. | ||
1276 | 16 | </p><p> | ||
1277 | 17 | There can be more than one version of a pricelist, each of | ||
1278 | 18 | these must be valid during a certain period of time. Some | ||
1279 | 19 | examples of versions: Main Prices, 2010, 2011, Summer Sales, | ||
1280 | 20 | etc. | ||
1281 | 21 | </p> | ||
1282 | 22 | </field> | ||
1283 | 23 | </record> | ||
1284 | 24 | |||
1285 | 25 | <record | ||
1286 | 26 | id="product_fixedprice_action_tree" | ||
1287 | 27 | model="ir.actions.act_window.view" | ||
1288 | 28 | > | ||
1289 | 29 | <field name="sequence" eval="99"/> | ||
1290 | 30 | <field name="view_mode">tree</field> | ||
1291 | 31 | <field name="view_id" ref="product_fixedprice_tree"/> | ||
1292 | 32 | <field name="act_window_id" ref="product_fixedprice_action"/> | ||
1293 | 33 | </record> | ||
1294 | 34 | |||
1295 | 35 | <record | ||
1296 | 36 | id="product_fixedprice_action_form" | ||
1297 | 37 | model="ir.actions.act_window.view" | ||
1298 | 38 | > | ||
1299 | 39 | <field name="sequence" eval="99"/> | ||
1300 | 40 | <field name="view_mode">form</field> | ||
1301 | 41 | <field name="view_id" ref="product_fixedprice_form"/> | ||
1302 | 42 | <field name="act_window_id" ref="product_fixedprice_action"/> | ||
1303 | 43 | </record> | ||
1304 | 44 | |||
1305 | 45 | <record | ||
1306 | 46 | id="product_fixedprice_version_action" | ||
1307 | 47 | model="ir.actions.act_window" | ||
1308 | 48 | > | ||
1309 | 49 | <field name="name">Fixed Pricelist versions</field> | ||
1310 | 50 | <field name="type">ir.actions.act_window</field> | ||
1311 | 51 | <field name="res_model">product.pricelist.version</field> | ||
1312 | 52 | <field name="view_type">form</field> | ||
1313 | 53 | <field name="domain">[('fixed_price', '=', True)]</field> | ||
1314 | 54 | <field name="context">{'default_fixed_price': True}</field> | ||
1315 | 55 | <field name="view_id" ref="product_fixedprice_version_tree"/> | ||
1316 | 56 | <field name="help" type="html"> | ||
1317 | 57 | <p class="oe_view_nocontent_create"> | ||
1318 | 58 | Click to add a pricelist version. | ||
1319 | 59 | </p><p> | ||
1320 | 60 | There can be more than one version of a pricelist, each of | ||
1321 | 61 | these must be valid during a certain period of time. Some | ||
1322 | 62 | examples of versions: Main Prices, 2010, 2011, Summer Sales, | ||
1323 | 63 | etc. | ||
1324 | 64 | </p> | ||
1325 | 65 | </field> | ||
1326 | 66 | </record> | ||
1327 | 67 | |||
1328 | 68 | <record | ||
1329 | 69 | id="product_fixedprice_version_action_tree" | ||
1330 | 70 | model="ir.actions.act_window.view" | ||
1331 | 71 | > | ||
1332 | 72 | <field name="sequence" eval="99"/> | ||
1333 | 73 | <field name="view_mode">tree</field> | ||
1334 | 74 | <field name="view_id" ref="product_fixedprice_version_tree"/> | ||
1335 | 75 | <field | ||
1336 | 76 | name="act_window_id" | ||
1337 | 77 | ref="product_fixedprice_version_action" | ||
1338 | 78 | /> | ||
1339 | 79 | </record> | ||
1340 | 80 | |||
1341 | 81 | <record | ||
1342 | 82 | id="product_fixedprice_version_action_form" | ||
1343 | 83 | model="ir.actions.act_window.view" | ||
1344 | 84 | > | ||
1345 | 85 | <field name="sequence" eval="99"/> | ||
1346 | 86 | <field name="view_mode">form</field> | ||
1347 | 87 | <field name="view_id" ref="product_fixedprice_version_form"/> | ||
1348 | 88 | <field | ||
1349 | 89 | name="act_window_id" | ||
1350 | 90 | ref="product_fixedprice_version_action" | ||
1351 | 91 | /> | ||
1352 | 92 | </record> | ||
1353 | 93 | |||
1354 | 94 | <menuitem | ||
1355 | 95 | id="product_fixedprice_menu" | ||
1356 | 96 | action="product_fixedprice_action" | ||
1357 | 97 | parent="product.menu_product_pricelist_main" | ||
1358 | 98 | sequence="22" | ||
1359 | 99 | /> | ||
1360 | 100 | |||
1361 | 101 | <menuitem | ||
1362 | 102 | id="product_fixedprice_version_menu" | ||
1363 | 103 | action="product_fixedprice_version_action" | ||
1364 | 104 | parent="product.menu_product_pricelist_main" | ||
1365 | 105 | sequence="24" | ||
1366 | 106 | /> | ||
1367 | 107 | |||
1368 | 108 | </data> | ||
1369 | 109 | </openerp> | ||
1370 | 0 | 110 | ||
1371 | === added file 'product_pricelist_fixed_price/view/pricelist_view.xml' | |||
1372 | --- product_pricelist_fixed_price/view/pricelist_view.xml 1970-01-01 00:00:00 +0000 | |||
1373 | +++ product_pricelist_fixed_price/view/pricelist_view.xml 2014-02-03 14:58:49 +0000 | |||
1374 | @@ -0,0 +1,268 @@ | |||
1375 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
1376 | 2 | <openerp> | ||
1377 | 3 | <data> | ||
1378 | 4 | |||
1379 | 5 | <!-- Basically this file contains simplified versions of the views | ||
1380 | 6 | for pricelist items, pricelist versions and pricelists. | ||
1381 | 7 | The views contain only the fields needed to add fixed prices. | ||
1382 | 8 | Actually the surcharche field is used for the fixed price, while | ||
1383 | 9 | the discount_factor is set to -1 to eliminate the role of the | ||
1384 | 10 | base price. | ||
1385 | 11 | For fixed prices product_id is (ofcourse?) required. | ||
1386 | 12 | --> | ||
1387 | 13 | |||
1388 | 14 | <!-- Pricelist item --> | ||
1389 | 15 | |||
1390 | 16 | <record id="product_fixedprice_item_tree" model="ir.ui.view"> | ||
1391 | 17 | <field name="name">product.fixedprice.item.tree</field> | ||
1392 | 18 | <field name="model">product.pricelist.item</field> | ||
1393 | 19 | <field name="priority">99</field> | ||
1394 | 20 | <field name="arch" type="xml"> | ||
1395 | 21 | <tree string="Products Fixed Price Items"> | ||
1396 | 22 | <field | ||
1397 | 23 | name="name" | ||
1398 | 24 | invisible="1" | ||
1399 | 25 | /> | ||
1400 | 26 | <field | ||
1401 | 27 | name="fixed_price" | ||
1402 | 28 | /> | ||
1403 | 29 | <field name="product_id"/> | ||
1404 | 30 | <field | ||
1405 | 31 | name="product_tmpl_id" | ||
1406 | 32 | groups="product.group_product_variant" | ||
1407 | 33 | /> | ||
1408 | 34 | <field name="min_quantity"/> | ||
1409 | 35 | <field | ||
1410 | 36 | name="price_surcharge" | ||
1411 | 37 | string="Price" | ||
1412 | 38 | /> | ||
1413 | 39 | </tree> | ||
1414 | 40 | </field> | ||
1415 | 41 | </record> | ||
1416 | 42 | |||
1417 | 43 | <record id="product_fixedprice_item_form" model="ir.ui.view"> | ||
1418 | 44 | <field name="name">product.fixedprice.item.form</field> | ||
1419 | 45 | <field name="model">product.pricelist.item</field> | ||
1420 | 46 | <field name="priority">99</field> | ||
1421 | 47 | <field name="arch" type="xml"> | ||
1422 | 48 | <form string="Products Fixed Price Items" version="7.0"> | ||
1423 | 49 | <field | ||
1424 | 50 | name="name" | ||
1425 | 51 | invisible="1" | ||
1426 | 52 | /> | ||
1427 | 53 | <field | ||
1428 | 54 | name="price_discount" | ||
1429 | 55 | invisible="1" | ||
1430 | 56 | /> | ||
1431 | 57 | <group col="4"> | ||
1432 | 58 | <field name="fixed_price" /> | ||
1433 | 59 | <field | ||
1434 | 60 | name="product_id" | ||
1435 | 61 | on_change="product_id_change(product_id)" | ||
1436 | 62 | required="1" | ||
1437 | 63 | /> | ||
1438 | 64 | <field | ||
1439 | 65 | name="product_tmpl_id" | ||
1440 | 66 | groups="product.group_product_variant" | ||
1441 | 67 | /> | ||
1442 | 68 | <field | ||
1443 | 69 | name="company_id" | ||
1444 | 70 | groups="base.group_multi_company" | ||
1445 | 71 | widget="selection" | ||
1446 | 72 | /> | ||
1447 | 73 | <field name="min_quantity"/> | ||
1448 | 74 | <field | ||
1449 | 75 | name="price_surcharge" | ||
1450 | 76 | string="Price" | ||
1451 | 77 | /> | ||
1452 | 78 | </group> | ||
1453 | 79 | </form> | ||
1454 | 80 | </field> | ||
1455 | 81 | </record> | ||
1456 | 82 | |||
1457 | 83 | |||
1458 | 84 | <!-- Pricelist version --> | ||
1459 | 85 | |||
1460 | 86 | <record id="product_fixedprice_version_tree" model="ir.ui.view"> | ||
1461 | 87 | <field name="name">product.fixedprice.version.tree</field> | ||
1462 | 88 | <field name="model">product.pricelist.version</field> | ||
1463 | 89 | <field name="priority">99</field> | ||
1464 | 90 | <field name="arch" type="xml"> | ||
1465 | 91 | <tree string="Fixed Pricelist Version"> | ||
1466 | 92 | <field | ||
1467 | 93 | name="fixed_price" | ||
1468 | 94 | invisible="1" | ||
1469 | 95 | /> | ||
1470 | 96 | <field name="name"/> | ||
1471 | 97 | <field name="pricelist_id"/> | ||
1472 | 98 | <field name="date_start"/> | ||
1473 | 99 | <field name="date_end"/> | ||
1474 | 100 | </tree> | ||
1475 | 101 | </field> | ||
1476 | 102 | </record> | ||
1477 | 103 | |||
1478 | 104 | <record id="product_fixedprice_version_form" model="ir.ui.view"> | ||
1479 | 105 | <field name="name">product.fixedprice.version.form</field> | ||
1480 | 106 | <field name="model">product.pricelist.version</field> | ||
1481 | 107 | <field name="priority">99</field> | ||
1482 | 108 | <field name="arch" type="xml"> | ||
1483 | 109 | <form string="Fixed Pricelist Version" version="7.0" > | ||
1484 | 110 | <group col="4"> | ||
1485 | 111 | <field name="name"/> | ||
1486 | 112 | <field name="active"/> | ||
1487 | 113 | <field | ||
1488 | 114 | colspan="4" | ||
1489 | 115 | name="pricelist_id" | ||
1490 | 116 | domain="[('fixed_price', '=', True),]" | ||
1491 | 117 | /> | ||
1492 | 118 | <field name="date_start"/> | ||
1493 | 119 | <field name="date_end"/> | ||
1494 | 120 | <field | ||
1495 | 121 | name="company_id" | ||
1496 | 122 | groups="base.group_multi_company" | ||
1497 | 123 | widget="selection" | ||
1498 | 124 | /> | ||
1499 | 125 | <field name="fixed_price" /> | ||
1500 | 126 | </group> | ||
1501 | 127 | <p></p> | ||
1502 | 128 | <field | ||
1503 | 129 | name="items_id" | ||
1504 | 130 | context="{ | ||
1505 | 131 | 'form_view_ref': 'product_pricelist_fixed_price.product_fixedprice_item_form', | ||
1506 | 132 | 'tree_view_ref': 'product_pricelist_fixed_price.product_fixedprice_item_tree', | ||
1507 | 133 | 'default_fixed_price': True, | ||
1508 | 134 | 'default_price_discount': -1, | ||
1509 | 135 | }" | ||
1510 | 136 | /> | ||
1511 | 137 | </form> | ||
1512 | 138 | </field> | ||
1513 | 139 | </record> | ||
1514 | 140 | |||
1515 | 141 | |||
1516 | 142 | <!-- Pricelist --> | ||
1517 | 143 | |||
1518 | 144 | <record model="ir.ui.view" id="product_fixedprice_search"> | ||
1519 | 145 | <field name="name">product.fixedprice.search</field> | ||
1520 | 146 | <field name="model">product.pricelist</field> | ||
1521 | 147 | <field name="priority">99</field> | ||
1522 | 148 | <field name="arch" type="xml"> | ||
1523 | 149 | <search string="Products Fixed Price Search"> | ||
1524 | 150 | <field name="name" string="Products Price"/> | ||
1525 | 151 | <field name="type"/> | ||
1526 | 152 | <field name="active" /> | ||
1527 | 153 | <field | ||
1528 | 154 | name="currency_id" | ||
1529 | 155 | groups="base.group_multi_currency" | ||
1530 | 156 | /> | ||
1531 | 157 | </search> | ||
1532 | 158 | </field> | ||
1533 | 159 | </record> | ||
1534 | 160 | |||
1535 | 161 | <record id="product_fixedprice_tree" model="ir.ui.view"> | ||
1536 | 162 | <field name="name">product.fixedprice.tree</field> | ||
1537 | 163 | <field name="model">product.pricelist</field> | ||
1538 | 164 | <field name="priority">99</field> | ||
1539 | 165 | <field name="arch" type="xml"> | ||
1540 | 166 | <tree string="Products Fixed Price List"> | ||
1541 | 167 | <field name="name"/> | ||
1542 | 168 | <field name="type"/> | ||
1543 | 169 | <field | ||
1544 | 170 | name="currency_id" | ||
1545 | 171 | groups="base.group_multi_currency" | ||
1546 | 172 | /> | ||
1547 | 173 | <field name="active" /> | ||
1548 | 174 | </tree> | ||
1549 | 175 | </field> | ||
1550 | 176 | </record> | ||
1551 | 177 | |||
1552 | 178 | <record id="product_fixedprice_form" model="ir.ui.view"> | ||
1553 | 179 | <field name="name">product.fixedprice.form</field> | ||
1554 | 180 | <field name="model">product.pricelist</field> | ||
1555 | 181 | <field name="priority">99</field> | ||
1556 | 182 | <field name="arch" type="xml"> | ||
1557 | 183 | <form string="Products Fixed Price List" version="7.0" > | ||
1558 | 184 | <field name="name"/> | ||
1559 | 185 | <group col="4"> | ||
1560 | 186 | <field name="active"/> | ||
1561 | 187 | <field name="type"/> | ||
1562 | 188 | <field | ||
1563 | 189 | name="currency_id" | ||
1564 | 190 | groups="base.group_multi_currency" | ||
1565 | 191 | /> | ||
1566 | 192 | <field | ||
1567 | 193 | name="company_id" | ||
1568 | 194 | groups="base.group_multi_company" | ||
1569 | 195 | widget="selection" | ||
1570 | 196 | /> | ||
1571 | 197 | </group> | ||
1572 | 198 | <p></p> | ||
1573 | 199 | <field | ||
1574 | 200 | name="version_id" | ||
1575 | 201 | context="{ | ||
1576 | 202 | 'form_view_ref': 'product_pricelist_fixed_price.product_fixedprice_version_form', | ||
1577 | 203 | 'tree_view_ref': 'product_pricelist_fixed_price.product_fixedprice_version_tree', | ||
1578 | 204 | 'default_pricelist_id': active_id, | ||
1579 | 205 | 'default_fixed_price': True, | ||
1580 | 206 | }" | ||
1581 | 207 | /> | ||
1582 | 208 | </form> | ||
1583 | 209 | </field> | ||
1584 | 210 | </record> | ||
1585 | 211 | |||
1586 | 212 | <!-- Add fixed price info to standard tree --> | ||
1587 | 213 | <record id="pricelist_item_tree_inherit" model="ir.ui.view"> | ||
1588 | 214 | <field name="name">pricelist.item.tree.inherit</field> | ||
1589 | 215 | <field name="model">product.pricelist.item</field> | ||
1590 | 216 | <field | ||
1591 | 217 | name="inherit_id" | ||
1592 | 218 | ref="product.product_pricelist_item_tree_view" | ||
1593 | 219 | /> | ||
1594 | 220 | <field name="arch" type="xml"> | ||
1595 | 221 | <field name="base" position="after"> | ||
1596 | 222 | <field name="fixed_price" /> | ||
1597 | 223 | <field name="price_surcharge" /> | ||
1598 | 224 | </field> | ||
1599 | 225 | </field> | ||
1600 | 226 | </record> | ||
1601 | 227 | |||
1602 | 228 | <!-- Add functionality for fixed prices also to standard form --> | ||
1603 | 229 | <record id="pricelist_item_form_inherit" model="ir.ui.view"> | ||
1604 | 230 | <field name="name">pricelist.item.form.inherit</field> | ||
1605 | 231 | <field name="model">product.pricelist.item</field> | ||
1606 | 232 | <field | ||
1607 | 233 | name="inherit_id" | ||
1608 | 234 | ref="product.product_pricelist_item_form_view" | ||
1609 | 235 | /> | ||
1610 | 236 | <field name="arch" type="xml"> | ||
1611 | 237 | <field name="sequence" position="after"> | ||
1612 | 238 | <field | ||
1613 | 239 | name="fixed_price" | ||
1614 | 240 | on_change="onchange_fixed_price(fixed_price, context)" | ||
1615 | 241 | attrs="{'invisible':[('product_id','=',False)]}" | ||
1616 | 242 | /> | ||
1617 | 243 | </field> | ||
1618 | 244 | <field name="price_discount" position="attributes"> | ||
1619 | 245 | <attribute | ||
1620 | 246 | name="attrs">{'readonly':[('fixed_price','=',True)]} | ||
1621 | 247 | </attribute> | ||
1622 | 248 | </field> | ||
1623 | 249 | <field name="price_round" position="attributes"> | ||
1624 | 250 | <attribute | ||
1625 | 251 | name="attrs">{'readonly':[('fixed_price','=',True)]} | ||
1626 | 252 | </attribute> | ||
1627 | 253 | </field> | ||
1628 | 254 | <field name="price_min_margin" position="attributes"> | ||
1629 | 255 | <attribute | ||
1630 | 256 | name="attrs">{'readonly':[('fixed_price','=',True)]} | ||
1631 | 257 | </attribute> | ||
1632 | 258 | </field> | ||
1633 | 259 | <field name="price_max_margin" position="attributes"> | ||
1634 | 260 | <attribute | ||
1635 | 261 | name="attrs">{'readonly':[('fixed_price','=',True)]} | ||
1636 | 262 | </attribute> | ||
1637 | 263 | </field> | ||
1638 | 264 | </field> | ||
1639 | 265 | </record> | ||
1640 | 266 | |||
1641 | 267 | </data> | ||
1642 | 268 | </openerp> |
Thanks for your work Ronald.
The idea to apply a 100% discount to get a fixed price seems correct to me. I would request a functional review to Lorenzo to check if that covers the use case for the old module.