Merge lp:~sandi-dirntis/openerpsl/openerpsl_20140219_2 into lp:openerpsl/7.0
- openerpsl_20140219_2
- Merge into 7.0
Proposed by
Aleksander Dirntiš
Status: | Merged |
---|---|
Merged at revision: | 330 |
Proposed branch: | lp:~sandi-dirntis/openerpsl/openerpsl_20140219_2 |
Merge into: | lp:openerpsl/7.0 |
Diff against target: |
744 lines (+368/-191) 16 files modified
account_tax_period/account_move_line.py (+19/-1) purchase_landing_costs/product_template.py (+2/-2) purchase_landing_costs/product_template_view.xml (+2/-2) purchase_recalculation/account_invoice.py (+0/-3) purchase_recalculation/stock_move.py (+13/-13) sale_order_extensions/__init__.py (+2/-1) sale_order_extensions/__openerp__.py (+4/-1) sale_order_extensions/i18n/en_US.po (+16/-0) sale_order_extensions/i18n/sale_order_extensions.pot (+16/-0) sale_order_extensions/i18n/sl.po (+0/-161) sale_order_extensions/i18n/sl_SI.po (+177/-0) sale_order_extensions/product_product.py (+10/-0) sale_order_extensions/product_product_view.xml (+20/-0) sale_order_extensions/res_partner.py (+34/-0) sale_order_extensions/res_partner_view.xml (+19/-0) sale_order_extensions/sale_order.py (+34/-7) |
To merge this branch: | bzr merge lp:~sandi-dirntis/openerpsl/openerpsl_20140219_2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mentis | Pending | ||
Review via email: mp+207238@code.launchpad.net |
Commit message
Description of the change
[FIX] Fixed landing cost setting on product
[MOD] Disabled period check between stock move and supplier invoice
[ADD] Added Sale Price functionality on product
To post a comment you must log in.
- 331. By Aleksander Dirntiš
-
[FIX] Fixed landing cost setting on product
[MOD] Disabled period check between stock move and supplier invoice
[ADD] Added Sale Price functionality on product
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'account_tax_period/account_move_line.py' | |||
2 | --- account_tax_period/account_move_line.py 2013-06-06 11:06:58 +0000 | |||
3 | +++ account_tax_period/account_move_line.py 2014-02-19 16:12:03 +0000 | |||
4 | @@ -31,12 +31,30 @@ | |||
5 | 31 | result.append(line.id) | 31 | result.append(line.id) |
6 | 32 | return result | 32 | return result |
7 | 33 | 33 | ||
8 | 34 | def _get_tax_period(self, cr, uid, context=None): | ||
9 | 35 | """ | ||
10 | 36 | Return default account period value | ||
11 | 37 | """ | ||
12 | 38 | context = context or {} | ||
13 | 39 | if context.get('tax_period_id', False): | ||
14 | 40 | return context['tax_period_id'] | ||
15 | 41 | account_period_obj = self.pool.get('account.period') | ||
16 | 42 | ctx = dict(context, account_period_prefer_normal=True) | ||
17 | 43 | ids = account_period_obj.find(cr, uid, context=ctx) | ||
18 | 44 | tax_period_id = False | ||
19 | 45 | if ids: | ||
20 | 46 | tax_period_id = ids[0] | ||
21 | 47 | return tax_period_id | ||
22 | 48 | |||
23 | 34 | _columns = { | 49 | _columns = { |
25 | 35 | 'tax_period_id': fields.related('move_id', 'tax_period_id', string='Tax Period', type='many2one', relation='account.period', select=True, | 50 | 'tax_period_id': fields.related('move_id', 'tax_period_id', string='Tax Period', type='many2one', relation='account.period', required=True, select=True, |
26 | 36 | store = { | 51 | store = { |
27 | 37 | 'account.move': (_get_move_lines, ['tax_period_id'], 20) | 52 | 'account.move': (_get_move_lines, ['tax_period_id'], 20) |
28 | 38 | }), | 53 | }), |
29 | 39 | 54 | ||
30 | 40 | } | 55 | } |
31 | 56 | _defaults = { | ||
32 | 57 | 'tax_period_id': _get_tax_period | ||
33 | 58 | } | ||
34 | 41 | 59 | ||
35 | 42 | account_move_line() | 60 | account_move_line() |
36 | 43 | \ No newline at end of file | 61 | \ No newline at end of file |
37 | 44 | 62 | ||
38 | === modified file 'purchase_landing_costs/product_template.py' | |||
39 | --- purchase_landing_costs/product_template.py 2013-01-24 13:09:31 +0000 | |||
40 | +++ purchase_landing_costs/product_template.py 2014-02-19 16:12:03 +0000 | |||
41 | @@ -30,8 +30,8 @@ | |||
42 | 30 | class product_template(osv.osv): | 30 | class product_template(osv.osv): |
43 | 31 | _inherit = "product.template" | 31 | _inherit = "product.template" |
44 | 32 | _columns = { | 32 | _columns = { |
47 | 33 | 'landing_cost' : fields.boolean('Landing Cost', help="Used if this product is landing cost"), | 33 | 'landing_cost' : fields.boolean('Landing Cost', help="Used if this product is landing cost"), |
48 | 34 | 'landing_cost_calculate' : fields.boolean('Calculate Landing Costs', help="Check this if you want to use landing cost calculation for average price for this product"), | 34 | 'landing_cost_calculate': fields.boolean('Calculate Landing Costs', help="Check this if you want to use landing cost calculation for average price for this product"), |
49 | 35 | } | 35 | } |
50 | 36 | _defaults = { | 36 | _defaults = { |
51 | 37 | 'landing_cost': False, | 37 | 'landing_cost': False, |
52 | 38 | 38 | ||
53 | === modified file 'purchase_landing_costs/product_template_view.xml' | |||
54 | --- purchase_landing_costs/product_template_view.xml 2012-12-11 11:23:50 +0000 | |||
55 | +++ purchase_landing_costs/product_template_view.xml 2014-02-19 16:12:03 +0000 | |||
56 | @@ -8,8 +8,8 @@ | |||
57 | 8 | <field name="arch" type="xml"> | 8 | <field name="arch" type="xml"> |
58 | 9 | <field name="price_extra" position="after"> | 9 | <field name="price_extra" position="after"> |
59 | 10 | <group name="landing_costs" string="Landing Costs"> | 10 | <group name="landing_costs" string="Landing Costs"> |
62 | 11 | <field name="landing_cost" attrs="{'readonly':[('landing_cost_calculate','=',True)]}"/> | 11 | <field name="landing_cost"/> |
63 | 12 | <field name="landing_cost_calculate" attrs="{'readonly':[('landing_cost','=',True)]}"/> | 12 | <field name="landing_cost_calculate"/> |
64 | 13 | </group> | 13 | </group> |
65 | 14 | </field> | 14 | </field> |
66 | 15 | </field> | 15 | </field> |
67 | 16 | 16 | ||
68 | === modified file 'purchase_recalculation/account_invoice.py' | |||
69 | --- purchase_recalculation/account_invoice.py 2014-01-19 16:54:08 +0000 | |||
70 | +++ purchase_recalculation/account_invoice.py 2014-02-19 16:12:03 +0000 | |||
71 | @@ -49,11 +49,8 @@ | |||
72 | 49 | if len(_stock_move_ids) > 0: | 49 | if len(_stock_move_ids) > 0: |
73 | 50 | _stock_moves = self.pool.get('stock.move').browse(cr, uid, _stock_move_ids, context) | 50 | _stock_moves = self.pool.get('stock.move').browse(cr, uid, _stock_move_ids, context) |
74 | 51 | for _stock_move in _stock_moves: | 51 | for _stock_move in _stock_moves: |
75 | 52 | if not _stock_move._move_check_period(context, _invoice.company_id.id, _invoice.period_id.id): | ||
76 | 53 | raise osv.except_osv(_('Error!'), _('Invoiced stock moves are not in same period as invoice.')) | ||
77 | 54 | _quantity = _quantity + _stock_move.product_qty | 52 | _quantity = _quantity + _stock_move.product_qty |
78 | 55 | _uom_id = _stock_move.product_uom.id | 53 | _uom_id = _stock_move.product_uom.id |
79 | 56 | |||
80 | 57 | 54 | ||
81 | 58 | if _line.uos_id.id == _uom_id: | 55 | if _line.uos_id.id == _uom_id: |
82 | 59 | if _quantity != _line.quantity: | 56 | if _quantity != _line.quantity: |
83 | 60 | 57 | ||
84 | === modified file 'purchase_recalculation/stock_move.py' | |||
85 | --- purchase_recalculation/stock_move.py 2013-11-18 10:17:54 +0000 | |||
86 | +++ purchase_recalculation/stock_move.py 2014-02-19 16:12:03 +0000 | |||
87 | @@ -86,19 +86,19 @@ | |||
88 | 86 | 'credit': _move.product_qty * _move.price_unit}) | 86 | 'credit': _move.product_qty * _move.price_unit}) |
89 | 87 | return True | 87 | return True |
90 | 88 | 88 | ||
104 | 89 | def _move_check_period(self, cr, uid, ids, context, company_id, period_id): | 89 | # def _move_check_period(self, cr, uid, ids, context, company_id, period_id): |
105 | 90 | if context is None: | 90 | # if context is None: |
106 | 91 | context = {} | 91 | # context = {} |
107 | 92 | period_obj = self.pool.get('account.period') | 92 | # period_obj = self.pool.get('account.period') |
108 | 93 | ctx = context.copy() | 93 | # ctx = context.copy() |
109 | 94 | ctx.update({'company_id': company_id, 'account_period_prefer_normal': True}) | 94 | # ctx.update({'company_id': company_id, 'account_period_prefer_normal': True}) |
110 | 95 | _match = True | 95 | # _match = True |
111 | 96 | _moves = self.pool.get('stock.move').browse(cr, uid, ids, context) | 96 | # _moves = self.pool.get('stock.move').browse(cr, uid, ids, context) |
112 | 97 | for _move in _moves: | 97 | # for _move in _moves: |
113 | 98 | _move_period_id = period_obj.find(cr, uid, _move.date, context=ctx)[0] | 98 | # _move_period_id = period_obj.find(cr, uid, _move.date, context=ctx)[0] |
114 | 99 | if _move_period_id != period_id: | 99 | # if _move_period_id != period_id: |
115 | 100 | _match = False | 100 | # _match = False |
116 | 101 | return _match | 101 | # return _match |
117 | 102 | 102 | ||
118 | 103 | def write(self, cr, uid, ids, vals, context=None): | 103 | def write(self, cr, uid, ids, vals, context=None): |
119 | 104 | if isinstance(ids, (int, long)): | 104 | if isinstance(ids, (int, long)): |
120 | 105 | 105 | ||
121 | === modified file 'sale_order_extensions/__init__.py' | |||
122 | --- sale_order_extensions/__init__.py 2014-01-12 20:54:03 +0000 | |||
123 | +++ sale_order_extensions/__init__.py 2014-02-19 16:12:03 +0000 | |||
124 | @@ -23,4 +23,5 @@ | |||
125 | 23 | import sale_shop | 23 | import sale_shop |
126 | 24 | import sale_order | 24 | import sale_order |
127 | 25 | import sale_order_line | 25 | import sale_order_line |
128 | 26 | import product_product | ||
129 | 27 | \ No newline at end of file | 26 | \ No newline at end of file |
130 | 27 | import product_product | ||
131 | 28 | import res_partner | ||
132 | 28 | \ No newline at end of file | 29 | \ No newline at end of file |
133 | 29 | 30 | ||
134 | === modified file 'sale_order_extensions/__openerp__.py' | |||
135 | --- sale_order_extensions/__openerp__.py 2014-01-12 20:54:03 +0000 | |||
136 | +++ sale_order_extensions/__openerp__.py 2014-02-19 16:12:03 +0000 | |||
137 | @@ -22,7 +22,7 @@ | |||
138 | 22 | 22 | ||
139 | 23 | { | 23 | { |
140 | 24 | 'name': 'Sale Order Extensions', | 24 | 'name': 'Sale Order Extensions', |
142 | 25 | 'version': '1.4', | 25 | 'version': '1.5', |
143 | 26 | 'category': 'Sale', | 26 | 'category': 'Sale', |
144 | 27 | 'description': """ | 27 | 'description': """ |
145 | 28 | This module adds following extensions to Sale Order: \n | 28 | This module adds following extensions to Sale Order: \n |
146 | @@ -35,10 +35,13 @@ | |||
147 | 35 | - adds field shop_production on shop for filtering shops \n | 35 | - adds field shop_production on shop for filtering shops \n |
148 | 36 | - adds quotations view for quotations from production shop with less fields \n | 36 | - adds quotations view for quotations from production shop with less fields \n |
149 | 37 | - adds quantity returned on sale order line for automatic product returns \n | 37 | - adds quantity returned on sale order line for automatic product returns \n |
150 | 38 | - adds sale price functionality on partners and products \n | ||
151 | 38 | """, | 39 | """, |
152 | 39 | 'author': 'Mentis d.o.o.', | 40 | 'author': 'Mentis d.o.o.', |
153 | 40 | 'depends': ['sale_stock'], | 41 | 'depends': ['sale_stock'], |
154 | 41 | 'data': [ | 42 | 'data': [ |
155 | 43 | 'product_product_view.xml', | ||
156 | 44 | 'res_partner_view.xml', | ||
157 | 42 | 'sale_shop_view.xml', | 45 | 'sale_shop_view.xml', |
158 | 43 | 'sale_order_view.xml', | 46 | 'sale_order_view.xml', |
159 | 44 | 'sale_order_workflow.xml' | 47 | 'sale_order_workflow.xml' |
160 | 45 | 48 | ||
161 | === modified file 'sale_order_extensions/i18n/en_US.po' | |||
162 | --- sale_order_extensions/i18n/en_US.po 2014-01-26 20:34:35 +0000 | |||
163 | +++ sale_order_extensions/i18n/en_US.po 2014-02-19 16:12:03 +0000 | |||
164 | @@ -153,3 +153,19 @@ | |||
165 | 153 | #: model:ir.model,name:sale_order_extensions.model_sale_order_line | 153 | #: model:ir.model,name:sale_order_extensions.model_sale_order_line |
166 | 154 | msgid "Sales Order Line" | 154 | msgid "Sales Order Line" |
167 | 155 | msgstr "" | 155 | msgstr "" |
168 | 156 | |||
169 | 157 | #. module: sale_order_extensions | ||
170 | 158 | #: view:product.product:0 | ||
171 | 159 | #: field:res.partner,sale_prices:0 | ||
172 | 160 | msgid "Sale Prices" | ||
173 | 161 | msgstr "" | ||
174 | 162 | |||
175 | 163 | #. module: sale_order_extensions | ||
176 | 164 | #: field:product.product,sale_price:0 | ||
177 | 165 | msgid "Sale Price" | ||
178 | 166 | msgstr "" | ||
179 | 167 | |||
180 | 168 | #. module: sale_order_extensions | ||
181 | 169 | #: field:product.product,sale_enabled:0 | ||
182 | 170 | msgid "Sale Enabled" | ||
183 | 171 | msgstr "" | ||
184 | 156 | 172 | ||
185 | === modified file 'sale_order_extensions/i18n/sale_order_extensions.pot' | |||
186 | --- sale_order_extensions/i18n/sale_order_extensions.pot 2014-01-26 20:34:35 +0000 | |||
187 | +++ sale_order_extensions/i18n/sale_order_extensions.pot 2014-02-19 16:12:03 +0000 | |||
188 | @@ -153,3 +153,19 @@ | |||
189 | 153 | #: model:ir.model,name:sale_order_extensions.model_sale_order_line | 153 | #: model:ir.model,name:sale_order_extensions.model_sale_order_line |
190 | 154 | msgid "Sales Order Line" | 154 | msgid "Sales Order Line" |
191 | 155 | msgstr "" | 155 | msgstr "" |
192 | 156 | |||
193 | 157 | #. module: sale_order_extensions | ||
194 | 158 | #: view:product.product:0 | ||
195 | 159 | #: field:res.partner,sale_prices:0 | ||
196 | 160 | msgid "Sale Prices" | ||
197 | 161 | msgstr "" | ||
198 | 162 | |||
199 | 163 | #. module: sale_order_extensions | ||
200 | 164 | #: field:product.product,sale_price:0 | ||
201 | 165 | msgid "Sale Price" | ||
202 | 166 | msgstr "" | ||
203 | 167 | |||
204 | 168 | #. module: sale_order_extensions | ||
205 | 169 | #: field:product.product,sale_enabled:0 | ||
206 | 170 | msgid "Sale Enabled" | ||
207 | 171 | msgstr "" | ||
208 | 156 | 172 | ||
209 | === removed file 'sale_order_extensions/i18n/sl.po' | |||
210 | --- sale_order_extensions/i18n/sl.po 2014-01-26 20:34:35 +0000 | |||
211 | +++ sale_order_extensions/i18n/sl.po 1970-01-01 00:00:00 +0000 | |||
212 | @@ -1,161 +0,0 @@ | |||
213 | 1 | # Translation of OpenERP Server. | ||
214 | 2 | # This file contains the translation of the following modules: | ||
215 | 3 | # * sale_order_extensions | ||
216 | 4 | # | ||
217 | 5 | msgid "" | ||
218 | 6 | msgstr "" | ||
219 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
220 | 8 | "Report-Msgid-Bugs-To: \n" | ||
221 | 9 | "POT-Creation-Date: 2014-01-21 16:41+0000\n" | ||
222 | 10 | "PO-Revision-Date: 2014-01-21 16:41+0000\n" | ||
223 | 11 | "Last-Translator: <>\n" | ||
224 | 12 | "Language-Team: \n" | ||
225 | 13 | "MIME-Version: 1.0\n" | ||
226 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
227 | 15 | "Content-Transfer-Encoding: \n" | ||
228 | 16 | "Plural-Forms: \n" | ||
229 | 17 | |||
230 | 18 | #. module: sale_order_extensions | ||
231 | 19 | #: field:sale.shop,shop_production:0 | ||
232 | 20 | msgid "Production Shop" | ||
233 | 21 | msgstr "Prodaja iz proizvodnje" | ||
234 | 22 | |||
235 | 23 | #. module: sale_order_extensions | ||
236 | 24 | #: code:addons/sale_order_extensions/sale_order.py:141 | ||
237 | 25 | #, python-format | ||
238 | 26 | msgid "Type \"service\" not set on next return products:" | ||
239 | 27 | msgstr "Izdelki za vračilo, ki niso vrste \"storitev\":" | ||
240 | 28 | |||
241 | 29 | #. module: sale_order_extensions | ||
242 | 30 | #: model:ir.model,name:sale_order_extensions.model_product_product | ||
243 | 31 | msgid "Product" | ||
244 | 32 | msgstr "Izdelek" | ||
245 | 33 | |||
246 | 34 | #. module: sale_order_extensions | ||
247 | 35 | #: model:ir.model,name:sale_order_extensions.model_sale_order | ||
248 | 36 | msgid "Sales Order" | ||
249 | 37 | msgstr "Prodajni nalog" | ||
250 | 38 | |||
251 | 39 | #. module: sale_order_extensions | ||
252 | 40 | #: view:sale.order:0 | ||
253 | 41 | msgid "Confirm Sale" | ||
254 | 42 | msgstr "Potrdi prodajo" | ||
255 | 43 | |||
256 | 44 | #. module: sale_order_extensions | ||
257 | 45 | #: view:sale.order:0 | ||
258 | 46 | msgid "Prepare" | ||
259 | 47 | msgstr "Pripravi" | ||
260 | 48 | |||
261 | 49 | #. module: sale_order_extensions | ||
262 | 50 | #: selection:sale.order,state:0 | ||
263 | 51 | msgid "Prepared for Confirm" | ||
264 | 52 | msgstr "Pripravljeno" | ||
265 | 53 | |||
266 | 54 | #. module: sale_order_extensions | ||
267 | 55 | #: code:addons/sale_order_extensions/sale_order.py:133 | ||
268 | 56 | #, python-format | ||
269 | 57 | msgid "Tax not set for next products:" | ||
270 | 58 | msgstr "Davek ni določen za izdelke:" | ||
271 | 59 | |||
272 | 60 | #. module: sale_order_extensions | ||
273 | 61 | #: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_quotations | ||
274 | 62 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_quotations | ||
275 | 63 | msgid "Quotations - Surplus" | ||
276 | 64 | msgstr "Ponudbe - Viški" | ||
277 | 65 | |||
278 | 66 | #. module: sale_order_extensions | ||
279 | 67 | #: model:ir.actions.act_window,name:sale_order_extensions.action_production_quotations | ||
280 | 68 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_quotations | ||
281 | 69 | msgid "Quotations - Production" | ||
282 | 70 | msgstr "Ponudbe - Proizvodnja" | ||
283 | 71 | |||
284 | 72 | #. module: sale_order_extensions | ||
285 | 73 | #: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_orders | ||
286 | 74 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_orders | ||
287 | 75 | msgid "Sales Orders - Surplus" | ||
288 | 76 | msgstr "Prodajni nalogi - Viški" | ||
289 | 77 | |||
290 | 78 | #. module: sale_order_extensions | ||
291 | 79 | #: model:ir.actions.act_window,name:sale_order_extensions.action_production_orders | ||
292 | 80 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_orders | ||
293 | 81 | msgid "Sales Orders - Production" | ||
294 | 82 | msgstr "Prodajni nalogi - Proizvodnja" | ||
295 | 83 | |||
296 | 84 | #. module: sale_order_extensions | ||
297 | 85 | #: view:sale.order:0 | ||
298 | 86 | msgid "Sales Order that haven't yet been confirmed" | ||
299 | 87 | msgstr "Nepotrjeni prodajni nalogi" | ||
300 | 88 | |||
301 | 89 | #. module: sale_order_extensions | ||
302 | 90 | #: view:sale.order:0 | ||
303 | 91 | msgid "Prepared" | ||
304 | 92 | msgstr "Pripravljeno" | ||
305 | 93 | |||
306 | 94 | #. module: sale_order_extensions | ||
307 | 95 | #: code:addons/sale_order_extensions/sale_order.py:120 | ||
308 | 96 | #: code:addons/sale_order_extensions/sale_order.py:128 | ||
309 | 97 | #: code:addons/sale_order_extensions/sale_order.py:136 | ||
310 | 98 | #: code:addons/sale_order_extensions/sale_order.py:144 | ||
311 | 99 | #, python-format | ||
312 | 100 | msgid "Error!" | ||
313 | 101 | msgstr "Napaka!" | ||
314 | 102 | |||
315 | 103 | #. module: sale_order_extensions | ||
316 | 104 | #: model:ir.actions.act_window,help:sale_order_extensions.action_production_quotations | ||
317 | 105 | #: model:ir.actions.act_window,help:sale_order_extensions.action_surplus_quotations | ||
318 | 106 | msgid "<p class=\"oe_view_nocontent_create\">\n" | ||
319 | 107 | " Click to create a quotation, the first step of a new sale.\n" | ||
320 | 108 | " </p><p>\n" | ||
321 | 109 | " OpenERP will help you handle efficiently the complete sale flow:\n" | ||
322 | 110 | " from the quotation to the sales order, the\n" | ||
323 | 111 | " delivery, the invoicing and the payment collection.\n" | ||
324 | 112 | " </p><p>\n" | ||
325 | 113 | " The social feature helps you organize discussions on each sales\n" | ||
326 | 114 | " order, and allow your customers to keep track of the evolution\n" | ||
327 | 115 | " of the sales order.\n" | ||
328 | 116 | " </p>\n" | ||
329 | 117 | " " | ||
330 | 118 | msgstr "<p class=\"oe_view_nocontent_create\">\n" | ||
331 | 119 | " Kliknite za izdelavo nove ponudbe.\n" | ||
332 | 120 | " </p><p>\n" | ||
333 | 121 | " OpenERP vam bo pomagal pri celotnem postopku prodaje:\n" | ||
334 | 122 | " od ponudbe do prodajnega naloga, dostave ter izdaje računa in plačil.\n" | ||
335 | 123 | " </p><p>\n" | ||
336 | 124 | " " | ||
337 | 125 | |||
338 | 126 | #. module: sale_order_extensions | ||
339 | 127 | #: model:ir.model,name:sale_order_extensions.model_sale_shop | ||
340 | 128 | msgid "Sales Shop" | ||
341 | 129 | msgstr "Trgovina" | ||
342 | 130 | |||
343 | 131 | #. module: sale_order_extensions | ||
344 | 132 | #: view:sale.order:0 | ||
345 | 133 | msgid "Set to Draft" | ||
346 | 134 | msgstr "Vrni v pripravo" | ||
347 | 135 | |||
348 | 136 | #. module: sale_order_extensions | ||
349 | 137 | #: code:addons/sale_order_extensions/sale_order.py:117 | ||
350 | 138 | #, python-format | ||
351 | 139 | msgid "Price not set for next products:" | ||
352 | 140 | msgstr "Cena ni določena za izdelke:" | ||
353 | 141 | |||
354 | 142 | #. module: sale_order_extensions | ||
355 | 143 | #: view:sale.order:0 | ||
356 | 144 | msgid "context.get('shop_production', False)" | ||
357 | 145 | msgstr "" | ||
358 | 146 | |||
359 | 147 | #. module: sale_order_extensions | ||
360 | 148 | #: view:sale.order:0 | ||
361 | 149 | msgid "Quotations" | ||
362 | 150 | msgstr "Ponudbe" | ||
363 | 151 | |||
364 | 152 | #. module: sale_order_extensions | ||
365 | 153 | #: code:addons/sale_order_extensions/sale_order.py:125 | ||
366 | 154 | #, python-format | ||
367 | 155 | msgid "Quantity not set for next products:" | ||
368 | 156 | msgstr "Količina ni določena za izdelke:" | ||
369 | 157 | |||
370 | 158 | #. module: sale_order_extensions | ||
371 | 159 | #: model:ir.model,name:sale_order_extensions.model_sale_order_line | ||
372 | 160 | msgid "Sales Order Line" | ||
373 | 161 | msgstr "Postavka prodajnega naloga" | ||
374 | 162 | 0 | ||
375 | === added file 'sale_order_extensions/i18n/sl_SI.po' | |||
376 | --- sale_order_extensions/i18n/sl_SI.po 1970-01-01 00:00:00 +0000 | |||
377 | +++ sale_order_extensions/i18n/sl_SI.po 2014-02-19 16:12:03 +0000 | |||
378 | @@ -0,0 +1,177 @@ | |||
379 | 1 | # Translation of OpenERP Server. | ||
380 | 2 | # This file contains the translation of the following modules: | ||
381 | 3 | # * sale_order_extensions | ||
382 | 4 | # | ||
383 | 5 | msgid "" | ||
384 | 6 | msgstr "" | ||
385 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
386 | 8 | "Report-Msgid-Bugs-To: \n" | ||
387 | 9 | "POT-Creation-Date: 2014-01-21 16:41+0000\n" | ||
388 | 10 | "PO-Revision-Date: 2014-01-21 16:41+0000\n" | ||
389 | 11 | "Last-Translator: <>\n" | ||
390 | 12 | "Language-Team: \n" | ||
391 | 13 | "MIME-Version: 1.0\n" | ||
392 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
393 | 15 | "Content-Transfer-Encoding: \n" | ||
394 | 16 | "Plural-Forms: \n" | ||
395 | 17 | |||
396 | 18 | #. module: sale_order_extensions | ||
397 | 19 | #: field:sale.shop,shop_production:0 | ||
398 | 20 | msgid "Production Shop" | ||
399 | 21 | msgstr "Prodaja iz proizvodnje" | ||
400 | 22 | |||
401 | 23 | #. module: sale_order_extensions | ||
402 | 24 | #: code:addons/sale_order_extensions/sale_order.py:141 | ||
403 | 25 | #, python-format | ||
404 | 26 | msgid "Type \"service\" not set on next return products:" | ||
405 | 27 | msgstr "Izdelki za vračilo, ki niso vrste \"storitev\":" | ||
406 | 28 | |||
407 | 29 | #. module: sale_order_extensions | ||
408 | 30 | #: model:ir.model,name:sale_order_extensions.model_product_product | ||
409 | 31 | msgid "Product" | ||
410 | 32 | msgstr "Izdelek" | ||
411 | 33 | |||
412 | 34 | #. module: sale_order_extensions | ||
413 | 35 | #: model:ir.model,name:sale_order_extensions.model_sale_order | ||
414 | 36 | msgid "Sales Order" | ||
415 | 37 | msgstr "Prodajni nalog" | ||
416 | 38 | |||
417 | 39 | #. module: sale_order_extensions | ||
418 | 40 | #: view:sale.order:0 | ||
419 | 41 | msgid "Confirm Sale" | ||
420 | 42 | msgstr "Potrdi prodajo" | ||
421 | 43 | |||
422 | 44 | #. module: sale_order_extensions | ||
423 | 45 | #: view:sale.order:0 | ||
424 | 46 | msgid "Prepare" | ||
425 | 47 | msgstr "Pripravi" | ||
426 | 48 | |||
427 | 49 | #. module: sale_order_extensions | ||
428 | 50 | #: selection:sale.order,state:0 | ||
429 | 51 | msgid "Prepared for Confirm" | ||
430 | 52 | msgstr "Pripravljeno" | ||
431 | 53 | |||
432 | 54 | #. module: sale_order_extensions | ||
433 | 55 | #: code:addons/sale_order_extensions/sale_order.py:133 | ||
434 | 56 | #, python-format | ||
435 | 57 | msgid "Tax not set for next products:" | ||
436 | 58 | msgstr "Davek ni določen za izdelke:" | ||
437 | 59 | |||
438 | 60 | #. module: sale_order_extensions | ||
439 | 61 | #: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_quotations | ||
440 | 62 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_quotations | ||
441 | 63 | msgid "Quotations - Surplus" | ||
442 | 64 | msgstr "Ponudbe - Viški" | ||
443 | 65 | |||
444 | 66 | #. module: sale_order_extensions | ||
445 | 67 | #: model:ir.actions.act_window,name:sale_order_extensions.action_production_quotations | ||
446 | 68 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_quotations | ||
447 | 69 | msgid "Quotations - Production" | ||
448 | 70 | msgstr "Ponudbe - Proizvodnja" | ||
449 | 71 | |||
450 | 72 | #. module: sale_order_extensions | ||
451 | 73 | #: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_orders | ||
452 | 74 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_orders | ||
453 | 75 | msgid "Sales Orders - Surplus" | ||
454 | 76 | msgstr "Prodajni nalogi - Viški" | ||
455 | 77 | |||
456 | 78 | #. module: sale_order_extensions | ||
457 | 79 | #: model:ir.actions.act_window,name:sale_order_extensions.action_production_orders | ||
458 | 80 | #: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_orders | ||
459 | 81 | msgid "Sales Orders - Production" | ||
460 | 82 | msgstr "Prodajni nalogi - Proizvodnja" | ||
461 | 83 | |||
462 | 84 | #. module: sale_order_extensions | ||
463 | 85 | #: view:sale.order:0 | ||
464 | 86 | msgid "Sales Order that haven't yet been confirmed" | ||
465 | 87 | msgstr "Nepotrjeni prodajni nalogi" | ||
466 | 88 | |||
467 | 89 | #. module: sale_order_extensions | ||
468 | 90 | #: view:sale.order:0 | ||
469 | 91 | msgid "Prepared" | ||
470 | 92 | msgstr "Pripravljeno" | ||
471 | 93 | |||
472 | 94 | #. module: sale_order_extensions | ||
473 | 95 | #: code:addons/sale_order_extensions/sale_order.py:120 | ||
474 | 96 | #: code:addons/sale_order_extensions/sale_order.py:128 | ||
475 | 97 | #: code:addons/sale_order_extensions/sale_order.py:136 | ||
476 | 98 | #: code:addons/sale_order_extensions/sale_order.py:144 | ||
477 | 99 | #, python-format | ||
478 | 100 | msgid "Error!" | ||
479 | 101 | msgstr "Napaka!" | ||
480 | 102 | |||
481 | 103 | #. module: sale_order_extensions | ||
482 | 104 | #: model:ir.actions.act_window,help:sale_order_extensions.action_production_quotations | ||
483 | 105 | #: model:ir.actions.act_window,help:sale_order_extensions.action_surplus_quotations | ||
484 | 106 | msgid "<p class=\"oe_view_nocontent_create\">\n" | ||
485 | 107 | " Click to create a quotation, the first step of a new sale.\n" | ||
486 | 108 | " </p><p>\n" | ||
487 | 109 | " OpenERP will help you handle efficiently the complete sale flow:\n" | ||
488 | 110 | " from the quotation to the sales order, the\n" | ||
489 | 111 | " delivery, the invoicing and the payment collection.\n" | ||
490 | 112 | " </p><p>\n" | ||
491 | 113 | " The social feature helps you organize discussions on each sales\n" | ||
492 | 114 | " order, and allow your customers to keep track of the evolution\n" | ||
493 | 115 | " of the sales order.\n" | ||
494 | 116 | " </p>\n" | ||
495 | 117 | " " | ||
496 | 118 | msgstr "<p class=\"oe_view_nocontent_create\">\n" | ||
497 | 119 | " Kliknite za izdelavo nove ponudbe.\n" | ||
498 | 120 | " </p><p>\n" | ||
499 | 121 | " OpenERP vam bo pomagal pri celotnem postopku prodaje:\n" | ||
500 | 122 | " od ponudbe do prodajnega naloga, dostave ter izdaje računa in plačil.\n" | ||
501 | 123 | " </p><p>\n" | ||
502 | 124 | " " | ||
503 | 125 | |||
504 | 126 | #. module: sale_order_extensions | ||
505 | 127 | #: model:ir.model,name:sale_order_extensions.model_sale_shop | ||
506 | 128 | msgid "Sales Shop" | ||
507 | 129 | msgstr "Trgovina" | ||
508 | 130 | |||
509 | 131 | #. module: sale_order_extensions | ||
510 | 132 | #: view:sale.order:0 | ||
511 | 133 | msgid "Set to Draft" | ||
512 | 134 | msgstr "Vrni v pripravo" | ||
513 | 135 | |||
514 | 136 | #. module: sale_order_extensions | ||
515 | 137 | #: code:addons/sale_order_extensions/sale_order.py:117 | ||
516 | 138 | #, python-format | ||
517 | 139 | msgid "Price not set for next products:" | ||
518 | 140 | msgstr "Cena ni določena za izdelke:" | ||
519 | 141 | |||
520 | 142 | #. module: sale_order_extensions | ||
521 | 143 | #: view:sale.order:0 | ||
522 | 144 | msgid "context.get('shop_production', False)" | ||
523 | 145 | msgstr "" | ||
524 | 146 | |||
525 | 147 | #. module: sale_order_extensions | ||
526 | 148 | #: view:sale.order:0 | ||
527 | 149 | msgid "Quotations" | ||
528 | 150 | msgstr "Ponudbe" | ||
529 | 151 | |||
530 | 152 | #. module: sale_order_extensions | ||
531 | 153 | #: code:addons/sale_order_extensions/sale_order.py:125 | ||
532 | 154 | #, python-format | ||
533 | 155 | msgid "Quantity not set for next products:" | ||
534 | 156 | msgstr "Količina ni določena za izdelke:" | ||
535 | 157 | |||
536 | 158 | #. module: sale_order_extensions | ||
537 | 159 | #: model:ir.model,name:sale_order_extensions.model_sale_order_line | ||
538 | 160 | msgid "Sales Order Line" | ||
539 | 161 | msgstr "Postavka prodajnega naloga" | ||
540 | 162 | |||
541 | 163 | #. module: sale_order_extensions | ||
542 | 164 | #: view:product.product:0 | ||
543 | 165 | #: field:res.partner,sale_prices:0 | ||
544 | 166 | msgid "Sale Prices" | ||
545 | 167 | msgstr "Uporaba akcijskih cen" | ||
546 | 168 | |||
547 | 169 | #. module: sale_order_extensions | ||
548 | 170 | #: field:product.product,sale_price:0 | ||
549 | 171 | msgid "Sale Price" | ||
550 | 172 | msgstr "Akcijska cena" | ||
551 | 173 | |||
552 | 174 | #. module: sale_order_extensions | ||
553 | 175 | #: field:product.product,sale_enabled:0 | ||
554 | 176 | msgid "Sale Enabled" | ||
555 | 177 | msgstr "Akcija omogočena" | ||
556 | 0 | 178 | ||
557 | === modified file 'sale_order_extensions/product_product.py' | |||
558 | --- sale_order_extensions/product_product.py 2014-01-06 20:29:28 +0000 | |||
559 | +++ sale_order_extensions/product_product.py 2014-02-19 16:12:03 +0000 | |||
560 | @@ -24,9 +24,19 @@ | |||
561 | 24 | from openerp import netsvc | 24 | from openerp import netsvc |
562 | 25 | from tools.translate import _ | 25 | from tools.translate import _ |
563 | 26 | from lxml import etree | 26 | from lxml import etree |
564 | 27 | import decimal_precision as dp | ||
565 | 27 | 28 | ||
566 | 28 | class product_product(osv.Model): | 29 | class product_product(osv.Model): |
567 | 29 | _inherit = 'product.product' | 30 | _inherit = 'product.product' |
568 | 31 | |||
569 | 32 | _columns = { | ||
570 | 33 | 'sale_enabled': fields.boolean('Sale Enabled'), | ||
571 | 34 | 'sale_price' : fields.float('Sale Price', digits_compute=dp.get_precision('Product Price'), ), | ||
572 | 35 | } | ||
573 | 36 | _defaults = { | ||
574 | 37 | 'sale_enabled': False, | ||
575 | 38 | 'sale_price': 0.0 | ||
576 | 39 | } | ||
577 | 30 | 40 | ||
578 | 31 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | 41 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): |
579 | 32 | res = super(product_product, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) | 42 | res = super(product_product, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) |
580 | 33 | 43 | ||
581 | === added file 'sale_order_extensions/product_product_view.xml' | |||
582 | --- sale_order_extensions/product_product_view.xml 1970-01-01 00:00:00 +0000 | |||
583 | +++ sale_order_extensions/product_product_view.xml 2014-02-19 16:12:03 +0000 | |||
584 | @@ -0,0 +1,20 @@ | |||
585 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
586 | 2 | <openerp> | ||
587 | 3 | <data> | ||
588 | 4 | |||
589 | 5 | <record id="product_sale_form_view" model="ir.ui.view"> | ||
590 | 6 | <field name="name">product.sale.form</field> | ||
591 | 7 | <field name="model">product.product</field> | ||
592 | 8 | <field name="inherit_id" ref="product.product_normal_form_view"/> | ||
593 | 9 | <field name="arch" type="xml"> | ||
594 | 10 | <xpath expr="//page[@string='Sales']" position="inside"> | ||
595 | 11 | <group string="Sale Prices"> | ||
596 | 12 | <field name="sale_enabled"/> | ||
597 | 13 | <field name="sale_price"/> | ||
598 | 14 | </group> | ||
599 | 15 | </xpath> | ||
600 | 16 | </field> | ||
601 | 17 | </record> | ||
602 | 18 | |||
603 | 19 | </data> | ||
604 | 20 | </openerp> | ||
605 | 0 | \ No newline at end of file | 21 | \ No newline at end of file |
606 | 1 | 22 | ||
607 | === added file 'sale_order_extensions/res_partner.py' | |||
608 | --- sale_order_extensions/res_partner.py 1970-01-01 00:00:00 +0000 | |||
609 | +++ sale_order_extensions/res_partner.py 2014-02-19 16:12:03 +0000 | |||
610 | @@ -0,0 +1,34 @@ | |||
611 | 1 | # -*- coding: utf-8 -*- | ||
612 | 2 | ############################################################################## | ||
613 | 3 | # | ||
614 | 4 | # OpenERP, Open Source Management Solution | ||
615 | 5 | # Copyright (C) 2004-TODAY OpenERP s.a. (<http://www.openerp.com>). | ||
616 | 6 | # Copyright (C) 2013-TODAY Mentis d.o.o. (<http://www.mentis.si/openerp>) | ||
617 | 7 | # | ||
618 | 8 | # This program is free software: you can redistribute it and/or modify | ||
619 | 9 | # it under the terms of the GNU Affero General Public License as | ||
620 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
621 | 11 | # License, or (at your option) any later version. | ||
622 | 12 | # | ||
623 | 13 | # This program is distributed in the hope that it will be useful, | ||
624 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
625 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
626 | 16 | # GNU Affero General Public License for more details. | ||
627 | 17 | # | ||
628 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
629 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
630 | 20 | # | ||
631 | 21 | ############################################################################## | ||
632 | 22 | |||
633 | 23 | from osv import osv, fields | ||
634 | 24 | from tools.translate import _ | ||
635 | 25 | |||
636 | 26 | class res_partner(osv.osv): | ||
637 | 27 | _inherit = 'res.partner' | ||
638 | 28 | |||
639 | 29 | _columns = { | ||
640 | 30 | 'sale_prices': fields.boolean('Sale Prices'), | ||
641 | 31 | } | ||
642 | 32 | _defaults = { | ||
643 | 33 | 'sale_prices': True, | ||
644 | 34 | } | ||
645 | 0 | \ No newline at end of file | 35 | \ No newline at end of file |
646 | 1 | 36 | ||
647 | === added file 'sale_order_extensions/res_partner_view.xml' | |||
648 | --- sale_order_extensions/res_partner_view.xml 1970-01-01 00:00:00 +0000 | |||
649 | +++ sale_order_extensions/res_partner_view.xml 2014-02-19 16:12:03 +0000 | |||
650 | @@ -0,0 +1,19 @@ | |||
651 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
652 | 2 | <openerp> | ||
653 | 3 | <data> | ||
654 | 4 | |||
655 | 5 | <record id="view_partner_sale_form" model="ir.ui.view"> | ||
656 | 6 | <field name="name">res.partner.sale.form</field> | ||
657 | 7 | <field name="model">res.partner</field> | ||
658 | 8 | <field name="inherit_id" ref="base.view_partner_form"/> | ||
659 | 9 | <field name="arch" type="xml"> | ||
660 | 10 | <xpath expr="//page[@string='Sales & Purchases']/group" position="inside"> | ||
661 | 11 | <group> | ||
662 | 12 | <field name="sale_prices"/> | ||
663 | 13 | </group> | ||
664 | 14 | </xpath> | ||
665 | 15 | </field> | ||
666 | 16 | </record> | ||
667 | 17 | |||
668 | 18 | </data> | ||
669 | 19 | </openerp> | ||
670 | 0 | \ No newline at end of file | 20 | \ No newline at end of file |
671 | 1 | 21 | ||
672 | === modified file 'sale_order_extensions/sale_order.py' | |||
673 | --- sale_order_extensions/sale_order.py 2014-01-27 21:03:32 +0000 | |||
674 | +++ sale_order_extensions/sale_order.py 2014-02-19 16:12:03 +0000 | |||
675 | @@ -79,16 +79,27 @@ | |||
676 | 79 | } | 79 | } |
677 | 80 | 80 | ||
678 | 81 | def date_order_change(self, cr, uid, ids, order_lines=False, date_order=False, pricelist=False, partner=False, fiscal_position=False, context=None): | 81 | def date_order_change(self, cr, uid, ids, order_lines=False, date_order=False, pricelist=False, partner=False, fiscal_position=False, context=None): |
679 | 82 | if context is None: | ||
680 | 83 | context = {} | ||
681 | 84 | |||
682 | 82 | res = {} | 85 | res = {} |
683 | 83 | 86 | ||
684 | 84 | if date_order: | 87 | if date_order: |
685 | 85 | self.pool.get('ir.values').set_default(cr, uid, 'sale.order', 'date_order', date_order, False, True, False) | 88 | self.pool.get('ir.values').set_default(cr, uid, 'sale.order', 'date_order', date_order, False, True, False) |
686 | 86 | 89 | ||
687 | 90 | _partner_id = False | ||
688 | 91 | if partner: | ||
689 | 92 | _partner_id = self.pool.get('res.partner').browse(cr, uid, partner, context) | ||
690 | 93 | |||
691 | 87 | _dp = self.pool.get('decimal.precision').precision_get(cr, uid, 'Product Price') | 94 | _dp = self.pool.get('decimal.precision').precision_get(cr, uid, 'Product Price') |
692 | 88 | |||
693 | 89 | if not ids: | 95 | if not ids: |
694 | 90 | for _line in order_lines: | 96 | for _line in order_lines: |
696 | 91 | if pricelist: | 97 | _product_id = self.pool.get('product.product').browse(cr, uid, _line[2]['product_id'], context) |
697 | 98 | if _product_id and _product_id.sale_enabled \ | ||
698 | 99 | and _partner_id and _partner_id.sale_prices: | ||
699 | 100 | _price = _product_id.sale_price | ||
700 | 101 | _line[2]['price_unit'] = round(_price, _dp) | ||
701 | 102 | elif pricelist: | ||
702 | 92 | _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], | 103 | _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], |
703 | 93 | _line[2]['product_id'], _line[2]['product_uom_qty'] or 1.0, partner, { | 104 | _line[2]['product_id'], _line[2]['product_uom_qty'] or 1.0, partner, { |
704 | 94 | 'uom': _line[2]['product_uom'] or result.get('product_uom'), | 105 | 'uom': _line[2]['product_uom'] or result.get('product_uom'), |
705 | @@ -101,7 +112,12 @@ | |||
706 | 101 | lines = [] | 112 | lines = [] |
707 | 102 | for _order in self.browse(cr, uid, ids, context): | 113 | for _order in self.browse(cr, uid, ids, context): |
708 | 103 | for _line in _order.order_line: | 114 | for _line in _order.order_line: |
710 | 104 | if pricelist: | 115 | if _line.product_id.sale_enabled and _partner_id.sale_prices: |
711 | 116 | _price = _line.product_id.sale_price | ||
712 | 117 | res = {'price_unit': round(_price, _dp), | ||
713 | 118 | 'price_subtotal': False} | ||
714 | 119 | lines.append((1, _line.id, res)) | ||
715 | 120 | elif pricelist: | ||
716 | 105 | _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], | 121 | _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], |
717 | 106 | _line.product_id.id, _line.product_uom_qty or 1.0, partner, { | 122 | _line.product_id.id, _line.product_uom_qty or 1.0, partner, { |
718 | 107 | 'uom': _line.product_uom.id or result.get('product_uom'), | 123 | 'uom': _line.product_uom.id or result.get('product_uom'), |
719 | @@ -177,10 +193,21 @@ | |||
720 | 177 | 193 | ||
721 | 178 | def _get_line_price(self, cr, uid, partner, pricelist, date_order, product, uom, uom_quantity): | 194 | def _get_line_price(self, cr, uid, partner, pricelist, date_order, product, uom, uom_quantity): |
722 | 179 | _dp = self.pool.get('decimal.precision').precision_get(cr, uid, 'Product Price') | 195 | _dp = self.pool.get('decimal.precision').precision_get(cr, uid, 'Product Price') |
727 | 180 | _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product, uom_quantity or 1.0, partner, | 196 | |
728 | 181 | {'uom': uom or result.get('uom'), | 197 | _partner_id = False |
729 | 182 | 'date': date_order} | 198 | _product_id = False |
730 | 183 | )[pricelist] or 0.0 | 199 | if partner and product: |
731 | 200 | _partner_id = self.pool.get('res.partner').browse(cr, uid, partner, None) | ||
732 | 201 | _product_id = self.pool.get('product.product').browse(cr, uid, product, None) | ||
733 | 202 | |||
734 | 203 | if _product_id and _product_id.sale_enabled \ | ||
735 | 204 | and _partner_id and _partner_id.sale_prices: | ||
736 | 205 | _price = _product_id.sale_price | ||
737 | 206 | else: | ||
738 | 207 | _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product, uom_quantity or 1.0, partner, | ||
739 | 208 | {'uom': uom or result.get('uom'), | ||
740 | 209 | 'date': date_order} | ||
741 | 210 | )[pricelist] or 0.0 | ||
742 | 184 | return _price | 211 | return _price |
743 | 185 | 212 | ||
744 | 186 | sale_order() | 213 | sale_order() |