Merge lp:~sandi-dirntis/openerpsl/openerpsl_20140219_2 into lp:openerpsl/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
Reviewer Review Type Date Requested Status
Mentis Pending
Review via email: mp+207238@code.launchpad.net

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
=== modified file 'account_tax_period/account_move_line.py'
--- account_tax_period/account_move_line.py 2013-06-06 11:06:58 +0000
+++ account_tax_period/account_move_line.py 2014-02-19 16:12:03 +0000
@@ -31,12 +31,30 @@
31 result.append(line.id)31 result.append(line.id)
32 return result32 return result
3333
34 def _get_tax_period(self, cr, uid, context=None):
35 """
36 Return default account period value
37 """
38 context = context or {}
39 if context.get('tax_period_id', False):
40 return context['tax_period_id']
41 account_period_obj = self.pool.get('account.period')
42 ctx = dict(context, account_period_prefer_normal=True)
43 ids = account_period_obj.find(cr, uid, context=ctx)
44 tax_period_id = False
45 if ids:
46 tax_period_id = ids[0]
47 return tax_period_id
48
34 _columns = {49 _columns = {
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,
36 store = {51 store = {
37 'account.move': (_get_move_lines, ['tax_period_id'], 20)52 'account.move': (_get_move_lines, ['tax_period_id'], 20)
38 }),53 }),
39 54
40 }55 }
56 _defaults = {
57 'tax_period_id': _get_tax_period
58 }
41 59
42account_move_line()60account_move_line()
43\ No newline at end of file61\ No newline at end of file
4462
=== modified file 'purchase_landing_costs/product_template.py'
--- purchase_landing_costs/product_template.py 2013-01-24 13:09:31 +0000
+++ purchase_landing_costs/product_template.py 2014-02-19 16:12:03 +0000
@@ -30,8 +30,8 @@
30class product_template(osv.osv):30class product_template(osv.osv):
31 _inherit = "product.template"31 _inherit = "product.template"
32 _columns = {32 _columns = {
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"),
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"),
35 }35 }
36 _defaults = {36 _defaults = {
37 'landing_cost': False,37 'landing_cost': False,
3838
=== modified file 'purchase_landing_costs/product_template_view.xml'
--- purchase_landing_costs/product_template_view.xml 2012-12-11 11:23:50 +0000
+++ purchase_landing_costs/product_template_view.xml 2014-02-19 16:12:03 +0000
@@ -8,8 +8,8 @@
8 <field name="arch" type="xml">8 <field name="arch" type="xml">
9 <field name="price_extra" position="after">9 <field name="price_extra" position="after">
10 <group name="landing_costs" string="Landing Costs">10 <group name="landing_costs" string="Landing Costs">
11 <field name="landing_cost" attrs="{'readonly':[('landing_cost_calculate','=',True)]}"/>11 <field name="landing_cost"/>
12 <field name="landing_cost_calculate" attrs="{'readonly':[('landing_cost','=',True)]}"/>12 <field name="landing_cost_calculate"/>
13 </group>13 </group>
14 </field>14 </field>
15 </field>15 </field>
1616
=== modified file 'purchase_recalculation/account_invoice.py'
--- purchase_recalculation/account_invoice.py 2014-01-19 16:54:08 +0000
+++ purchase_recalculation/account_invoice.py 2014-02-19 16:12:03 +0000
@@ -49,11 +49,8 @@
49 if len(_stock_move_ids) > 0:49 if len(_stock_move_ids) > 0:
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)
51 for _stock_move in _stock_moves:51 for _stock_move in _stock_moves:
52 if not _stock_move._move_check_period(context, _invoice.company_id.id, _invoice.period_id.id):
53 raise osv.except_osv(_('Error!'), _('Invoiced stock moves are not in same period as invoice.'))
54 _quantity = _quantity + _stock_move.product_qty52 _quantity = _quantity + _stock_move.product_qty
55 _uom_id = _stock_move.product_uom.id53 _uom_id = _stock_move.product_uom.id
56
57 54
58 if _line.uos_id.id == _uom_id:55 if _line.uos_id.id == _uom_id:
59 if _quantity != _line.quantity:56 if _quantity != _line.quantity:
6057
=== modified file 'purchase_recalculation/stock_move.py'
--- purchase_recalculation/stock_move.py 2013-11-18 10:17:54 +0000
+++ purchase_recalculation/stock_move.py 2014-02-19 16:12:03 +0000
@@ -86,19 +86,19 @@
86 'credit': _move.product_qty * _move.price_unit})86 'credit': _move.product_qty * _move.price_unit})
87 return True87 return True
8888
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):
90 if context is None:90# if context is None:
91 context = {}91# context = {}
92 period_obj = self.pool.get('account.period')92# period_obj = self.pool.get('account.period')
93 ctx = context.copy()93# ctx = context.copy()
94 ctx.update({'company_id': company_id, 'account_period_prefer_normal': True})94# ctx.update({'company_id': company_id, 'account_period_prefer_normal': True})
95 _match = True95# _match = True
96 _moves = self.pool.get('stock.move').browse(cr, uid, ids, context)96# _moves = self.pool.get('stock.move').browse(cr, uid, ids, context)
97 for _move in _moves:97# for _move in _moves:
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]
99 if _move_period_id != period_id:99# if _move_period_id != period_id:
100 _match = False100# _match = False
101 return _match 101# return _match
102102
103 def write(self, cr, uid, ids, vals, context=None):103 def write(self, cr, uid, ids, vals, context=None):
104 if isinstance(ids, (int, long)):104 if isinstance(ids, (int, long)):
105105
=== modified file 'sale_order_extensions/__init__.py'
--- sale_order_extensions/__init__.py 2014-01-12 20:54:03 +0000
+++ sale_order_extensions/__init__.py 2014-02-19 16:12:03 +0000
@@ -23,4 +23,5 @@
23import sale_shop23import sale_shop
24import sale_order24import sale_order
25import sale_order_line25import sale_order_line
26import product_product
27\ No newline at end of file26\ No newline at end of file
27import product_product
28import res_partner
28\ No newline at end of file29\ No newline at end of file
2930
=== modified file 'sale_order_extensions/__openerp__.py'
--- sale_order_extensions/__openerp__.py 2014-01-12 20:54:03 +0000
+++ sale_order_extensions/__openerp__.py 2014-02-19 16:12:03 +0000
@@ -22,7 +22,7 @@
2222
23{23{
24 'name': 'Sale Order Extensions',24 'name': 'Sale Order Extensions',
25 'version': '1.4',25 'version': '1.5',
26 'category': 'Sale',26 'category': 'Sale',
27 'description': """27 'description': """
28 This module adds following extensions to Sale Order: \n28 This module adds following extensions to Sale Order: \n
@@ -35,10 +35,13 @@
35 - adds field shop_production on shop for filtering shops \n35 - adds field shop_production on shop for filtering shops \n
36 - adds quotations view for quotations from production shop with less fields \n36 - adds quotations view for quotations from production shop with less fields \n
37 - adds quantity returned on sale order line for automatic product returns \n37 - adds quantity returned on sale order line for automatic product returns \n
38 - adds sale price functionality on partners and products \n
38 """,39 """,
39 'author': 'Mentis d.o.o.',40 'author': 'Mentis d.o.o.',
40 'depends': ['sale_stock'],41 'depends': ['sale_stock'],
41 'data': [42 'data': [
43 'product_product_view.xml',
44 'res_partner_view.xml',
42 'sale_shop_view.xml',45 'sale_shop_view.xml',
43 'sale_order_view.xml',46 'sale_order_view.xml',
44 'sale_order_workflow.xml'47 'sale_order_workflow.xml'
4548
=== modified file 'sale_order_extensions/i18n/en_US.po'
--- sale_order_extensions/i18n/en_US.po 2014-01-26 20:34:35 +0000
+++ sale_order_extensions/i18n/en_US.po 2014-02-19 16:12:03 +0000
@@ -153,3 +153,19 @@
153#: model:ir.model,name:sale_order_extensions.model_sale_order_line153#: model:ir.model,name:sale_order_extensions.model_sale_order_line
154msgid "Sales Order Line"154msgid "Sales Order Line"
155msgstr ""155msgstr ""
156
157#. module: sale_order_extensions
158#: view:product.product:0
159#: field:res.partner,sale_prices:0
160msgid "Sale Prices"
161msgstr ""
162
163#. module: sale_order_extensions
164#: field:product.product,sale_price:0
165msgid "Sale Price"
166msgstr ""
167
168#. module: sale_order_extensions
169#: field:product.product,sale_enabled:0
170msgid "Sale Enabled"
171msgstr ""
156172
=== modified file 'sale_order_extensions/i18n/sale_order_extensions.pot'
--- sale_order_extensions/i18n/sale_order_extensions.pot 2014-01-26 20:34:35 +0000
+++ sale_order_extensions/i18n/sale_order_extensions.pot 2014-02-19 16:12:03 +0000
@@ -153,3 +153,19 @@
153#: model:ir.model,name:sale_order_extensions.model_sale_order_line153#: model:ir.model,name:sale_order_extensions.model_sale_order_line
154msgid "Sales Order Line"154msgid "Sales Order Line"
155msgstr ""155msgstr ""
156
157#. module: sale_order_extensions
158#: view:product.product:0
159#: field:res.partner,sale_prices:0
160msgid "Sale Prices"
161msgstr ""
162
163#. module: sale_order_extensions
164#: field:product.product,sale_price:0
165msgid "Sale Price"
166msgstr ""
167
168#. module: sale_order_extensions
169#: field:product.product,sale_enabled:0
170msgid "Sale Enabled"
171msgstr ""
156172
=== removed file 'sale_order_extensions/i18n/sl.po'
--- sale_order_extensions/i18n/sl.po 2014-01-26 20:34:35 +0000
+++ sale_order_extensions/i18n/sl.po 1970-01-01 00:00:00 +0000
@@ -1,161 +0,0 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * sale_order_extensions
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-01-21 16:41+0000\n"
10"PO-Revision-Date: 2014-01-21 16:41+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: sale_order_extensions
19#: field:sale.shop,shop_production:0
20msgid "Production Shop"
21msgstr "Prodaja iz proizvodnje"
22
23#. module: sale_order_extensions
24#: code:addons/sale_order_extensions/sale_order.py:141
25#, python-format
26msgid "Type \"service\" not set on next return products:"
27msgstr "Izdelki za vračilo, ki niso vrste \"storitev\":"
28
29#. module: sale_order_extensions
30#: model:ir.model,name:sale_order_extensions.model_product_product
31msgid "Product"
32msgstr "Izdelek"
33
34#. module: sale_order_extensions
35#: model:ir.model,name:sale_order_extensions.model_sale_order
36msgid "Sales Order"
37msgstr "Prodajni nalog"
38
39#. module: sale_order_extensions
40#: view:sale.order:0
41msgid "Confirm Sale"
42msgstr "Potrdi prodajo"
43
44#. module: sale_order_extensions
45#: view:sale.order:0
46msgid "Prepare"
47msgstr "Pripravi"
48
49#. module: sale_order_extensions
50#: selection:sale.order,state:0
51msgid "Prepared for Confirm"
52msgstr "Pripravljeno"
53
54#. module: sale_order_extensions
55#: code:addons/sale_order_extensions/sale_order.py:133
56#, python-format
57msgid "Tax not set for next products:"
58msgstr "Davek ni določen za izdelke:"
59
60#. module: sale_order_extensions
61#: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_quotations
62#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_quotations
63msgid "Quotations - Surplus"
64msgstr "Ponudbe - Viški"
65
66#. module: sale_order_extensions
67#: model:ir.actions.act_window,name:sale_order_extensions.action_production_quotations
68#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_quotations
69msgid "Quotations - Production"
70msgstr "Ponudbe - Proizvodnja"
71
72#. module: sale_order_extensions
73#: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_orders
74#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_orders
75msgid "Sales Orders - Surplus"
76msgstr "Prodajni nalogi - Viški"
77
78#. module: sale_order_extensions
79#: model:ir.actions.act_window,name:sale_order_extensions.action_production_orders
80#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_orders
81msgid "Sales Orders - Production"
82msgstr "Prodajni nalogi - Proizvodnja"
83
84#. module: sale_order_extensions
85#: view:sale.order:0
86msgid "Sales Order that haven't yet been confirmed"
87msgstr "Nepotrjeni prodajni nalogi"
88
89#. module: sale_order_extensions
90#: view:sale.order:0
91msgid "Prepared"
92msgstr "Pripravljeno"
93
94#. module: sale_order_extensions
95#: code:addons/sale_order_extensions/sale_order.py:120
96#: code:addons/sale_order_extensions/sale_order.py:128
97#: code:addons/sale_order_extensions/sale_order.py:136
98#: code:addons/sale_order_extensions/sale_order.py:144
99#, python-format
100msgid "Error!"
101msgstr "Napaka!"
102
103#. module: sale_order_extensions
104#: model:ir.actions.act_window,help:sale_order_extensions.action_production_quotations
105#: model:ir.actions.act_window,help:sale_order_extensions.action_surplus_quotations
106msgid "<p class=\"oe_view_nocontent_create\">\n"
107" Click to create a quotation, the first step of a new sale.\n"
108" </p><p>\n"
109" OpenERP will help you handle efficiently the complete sale flow:\n"
110" from the quotation to the sales order, the\n"
111" delivery, the invoicing and the payment collection.\n"
112" </p><p>\n"
113" The social feature helps you organize discussions on each sales\n"
114" order, and allow your customers to keep track of the evolution\n"
115" of the sales order.\n"
116" </p>\n"
117" "
118msgstr "<p class=\"oe_view_nocontent_create\">\n"
119" Kliknite za izdelavo nove ponudbe.\n"
120" </p><p>\n"
121" OpenERP vam bo pomagal pri celotnem postopku prodaje:\n"
122" od ponudbe do prodajnega naloga, dostave ter izdaje računa in plačil.\n"
123" </p><p>\n"
124" "
125
126#. module: sale_order_extensions
127#: model:ir.model,name:sale_order_extensions.model_sale_shop
128msgid "Sales Shop"
129msgstr "Trgovina"
130
131#. module: sale_order_extensions
132#: view:sale.order:0
133msgid "Set to Draft"
134msgstr "Vrni v pripravo"
135
136#. module: sale_order_extensions
137#: code:addons/sale_order_extensions/sale_order.py:117
138#, python-format
139msgid "Price not set for next products:"
140msgstr "Cena ni določena za izdelke:"
141
142#. module: sale_order_extensions
143#: view:sale.order:0
144msgid "context.get('shop_production', False)"
145msgstr ""
146
147#. module: sale_order_extensions
148#: view:sale.order:0
149msgid "Quotations"
150msgstr "Ponudbe"
151
152#. module: sale_order_extensions
153#: code:addons/sale_order_extensions/sale_order.py:125
154#, python-format
155msgid "Quantity not set for next products:"
156msgstr "Količina ni določena za izdelke:"
157
158#. module: sale_order_extensions
159#: model:ir.model,name:sale_order_extensions.model_sale_order_line
160msgid "Sales Order Line"
161msgstr "Postavka prodajnega naloga"
1620
=== added file 'sale_order_extensions/i18n/sl_SI.po'
--- sale_order_extensions/i18n/sl_SI.po 1970-01-01 00:00:00 +0000
+++ sale_order_extensions/i18n/sl_SI.po 2014-02-19 16:12:03 +0000
@@ -0,0 +1,177 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * sale_order_extensions
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-01-21 16:41+0000\n"
10"PO-Revision-Date: 2014-01-21 16:41+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: sale_order_extensions
19#: field:sale.shop,shop_production:0
20msgid "Production Shop"
21msgstr "Prodaja iz proizvodnje"
22
23#. module: sale_order_extensions
24#: code:addons/sale_order_extensions/sale_order.py:141
25#, python-format
26msgid "Type \"service\" not set on next return products:"
27msgstr "Izdelki za vračilo, ki niso vrste \"storitev\":"
28
29#. module: sale_order_extensions
30#: model:ir.model,name:sale_order_extensions.model_product_product
31msgid "Product"
32msgstr "Izdelek"
33
34#. module: sale_order_extensions
35#: model:ir.model,name:sale_order_extensions.model_sale_order
36msgid "Sales Order"
37msgstr "Prodajni nalog"
38
39#. module: sale_order_extensions
40#: view:sale.order:0
41msgid "Confirm Sale"
42msgstr "Potrdi prodajo"
43
44#. module: sale_order_extensions
45#: view:sale.order:0
46msgid "Prepare"
47msgstr "Pripravi"
48
49#. module: sale_order_extensions
50#: selection:sale.order,state:0
51msgid "Prepared for Confirm"
52msgstr "Pripravljeno"
53
54#. module: sale_order_extensions
55#: code:addons/sale_order_extensions/sale_order.py:133
56#, python-format
57msgid "Tax not set for next products:"
58msgstr "Davek ni določen za izdelke:"
59
60#. module: sale_order_extensions
61#: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_quotations
62#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_quotations
63msgid "Quotations - Surplus"
64msgstr "Ponudbe - Viški"
65
66#. module: sale_order_extensions
67#: model:ir.actions.act_window,name:sale_order_extensions.action_production_quotations
68#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_quotations
69msgid "Quotations - Production"
70msgstr "Ponudbe - Proizvodnja"
71
72#. module: sale_order_extensions
73#: model:ir.actions.act_window,name:sale_order_extensions.action_surplus_orders
74#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_surplus_orders
75msgid "Sales Orders - Surplus"
76msgstr "Prodajni nalogi - Viški"
77
78#. module: sale_order_extensions
79#: model:ir.actions.act_window,name:sale_order_extensions.action_production_orders
80#: model:ir.ui.menu,name:sale_order_extensions.menu_sale_production_orders
81msgid "Sales Orders - Production"
82msgstr "Prodajni nalogi - Proizvodnja"
83
84#. module: sale_order_extensions
85#: view:sale.order:0
86msgid "Sales Order that haven't yet been confirmed"
87msgstr "Nepotrjeni prodajni nalogi"
88
89#. module: sale_order_extensions
90#: view:sale.order:0
91msgid "Prepared"
92msgstr "Pripravljeno"
93
94#. module: sale_order_extensions
95#: code:addons/sale_order_extensions/sale_order.py:120
96#: code:addons/sale_order_extensions/sale_order.py:128
97#: code:addons/sale_order_extensions/sale_order.py:136
98#: code:addons/sale_order_extensions/sale_order.py:144
99#, python-format
100msgid "Error!"
101msgstr "Napaka!"
102
103#. module: sale_order_extensions
104#: model:ir.actions.act_window,help:sale_order_extensions.action_production_quotations
105#: model:ir.actions.act_window,help:sale_order_extensions.action_surplus_quotations
106msgid "<p class=\"oe_view_nocontent_create\">\n"
107" Click to create a quotation, the first step of a new sale.\n"
108" </p><p>\n"
109" OpenERP will help you handle efficiently the complete sale flow:\n"
110" from the quotation to the sales order, the\n"
111" delivery, the invoicing and the payment collection.\n"
112" </p><p>\n"
113" The social feature helps you organize discussions on each sales\n"
114" order, and allow your customers to keep track of the evolution\n"
115" of the sales order.\n"
116" </p>\n"
117" "
118msgstr "<p class=\"oe_view_nocontent_create\">\n"
119" Kliknite za izdelavo nove ponudbe.\n"
120" </p><p>\n"
121" OpenERP vam bo pomagal pri celotnem postopku prodaje:\n"
122" od ponudbe do prodajnega naloga, dostave ter izdaje računa in plačil.\n"
123" </p><p>\n"
124" "
125
126#. module: sale_order_extensions
127#: model:ir.model,name:sale_order_extensions.model_sale_shop
128msgid "Sales Shop"
129msgstr "Trgovina"
130
131#. module: sale_order_extensions
132#: view:sale.order:0
133msgid "Set to Draft"
134msgstr "Vrni v pripravo"
135
136#. module: sale_order_extensions
137#: code:addons/sale_order_extensions/sale_order.py:117
138#, python-format
139msgid "Price not set for next products:"
140msgstr "Cena ni določena za izdelke:"
141
142#. module: sale_order_extensions
143#: view:sale.order:0
144msgid "context.get('shop_production', False)"
145msgstr ""
146
147#. module: sale_order_extensions
148#: view:sale.order:0
149msgid "Quotations"
150msgstr "Ponudbe"
151
152#. module: sale_order_extensions
153#: code:addons/sale_order_extensions/sale_order.py:125
154#, python-format
155msgid "Quantity not set for next products:"
156msgstr "Količina ni določena za izdelke:"
157
158#. module: sale_order_extensions
159#: model:ir.model,name:sale_order_extensions.model_sale_order_line
160msgid "Sales Order Line"
161msgstr "Postavka prodajnega naloga"
162
163#. module: sale_order_extensions
164#: view:product.product:0
165#: field:res.partner,sale_prices:0
166msgid "Sale Prices"
167msgstr "Uporaba akcijskih cen"
168
169#. module: sale_order_extensions
170#: field:product.product,sale_price:0
171msgid "Sale Price"
172msgstr "Akcijska cena"
173
174#. module: sale_order_extensions
175#: field:product.product,sale_enabled:0
176msgid "Sale Enabled"
177msgstr "Akcija omogočena"
0178
=== modified file 'sale_order_extensions/product_product.py'
--- sale_order_extensions/product_product.py 2014-01-06 20:29:28 +0000
+++ sale_order_extensions/product_product.py 2014-02-19 16:12:03 +0000
@@ -24,9 +24,19 @@
24from openerp import netsvc24from openerp import netsvc
25from tools.translate import _25from tools.translate import _
26from lxml import etree26from lxml import etree
27import decimal_precision as dp
2728
28class product_product(osv.Model):29class product_product(osv.Model):
29 _inherit = 'product.product'30 _inherit = 'product.product'
31
32 _columns = {
33 'sale_enabled': fields.boolean('Sale Enabled'),
34 'sale_price' : fields.float('Sale Price', digits_compute=dp.get_precision('Product Price'), ),
35 }
36 _defaults = {
37 'sale_enabled': False,
38 'sale_price': 0.0
39 }
3040
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):
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)
3343
=== added file 'sale_order_extensions/product_product_view.xml'
--- sale_order_extensions/product_product_view.xml 1970-01-01 00:00:00 +0000
+++ sale_order_extensions/product_product_view.xml 2014-02-19 16:12:03 +0000
@@ -0,0 +1,20 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="product_sale_form_view" model="ir.ui.view">
6 <field name="name">product.sale.form</field>
7 <field name="model">product.product</field>
8 <field name="inherit_id" ref="product.product_normal_form_view"/>
9 <field name="arch" type="xml">
10 <xpath expr="//page[@string='Sales']" position="inside">
11 <group string="Sale Prices">
12 <field name="sale_enabled"/>
13 <field name="sale_price"/>
14 </group>
15 </xpath>
16 </field>
17 </record>
18
19 </data>
20</openerp>
0\ No newline at end of file21\ No newline at end of file
122
=== added file 'sale_order_extensions/res_partner.py'
--- sale_order_extensions/res_partner.py 1970-01-01 00:00:00 +0000
+++ sale_order_extensions/res_partner.py 2014-02-19 16:12:03 +0000
@@ -0,0 +1,34 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-TODAY OpenERP s.a. (<http://www.openerp.com>).
6# Copyright (C) 2013-TODAY Mentis d.o.o. (<http://www.mentis.si/openerp>)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import osv, fields
24from tools.translate import _
25
26class res_partner(osv.osv):
27 _inherit = 'res.partner'
28
29 _columns = {
30 'sale_prices': fields.boolean('Sale Prices'),
31 }
32 _defaults = {
33 'sale_prices': True,
34 }
0\ No newline at end of file35\ No newline at end of file
136
=== added file 'sale_order_extensions/res_partner_view.xml'
--- sale_order_extensions/res_partner_view.xml 1970-01-01 00:00:00 +0000
+++ sale_order_extensions/res_partner_view.xml 2014-02-19 16:12:03 +0000
@@ -0,0 +1,19 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="view_partner_sale_form" model="ir.ui.view">
6 <field name="name">res.partner.sale.form</field>
7 <field name="model">res.partner</field>
8 <field name="inherit_id" ref="base.view_partner_form"/>
9 <field name="arch" type="xml">
10 <xpath expr="//page[@string='Sales &amp; Purchases']/group" position="inside">
11 <group>
12 <field name="sale_prices"/>
13 </group>
14 </xpath>
15 </field>
16 </record>
17
18 </data>
19</openerp>
0\ No newline at end of file20\ No newline at end of file
121
=== modified file 'sale_order_extensions/sale_order.py'
--- sale_order_extensions/sale_order.py 2014-01-27 21:03:32 +0000
+++ sale_order_extensions/sale_order.py 2014-02-19 16:12:03 +0000
@@ -79,16 +79,27 @@
79 }79 }
8080
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):
82 if context is None:
83 context = {}
84
82 res = {}85 res = {}
83 86
84 if date_order:87 if date_order:
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)
8689
90 _partner_id = False
91 if partner:
92 _partner_id = self.pool.get('res.partner').browse(cr, uid, partner, context)
93
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')
88
89 if not ids:95 if not ids:
90 for _line in order_lines:96 for _line in order_lines:
91 if pricelist:97 _product_id = self.pool.get('product.product').browse(cr, uid, _line[2]['product_id'], context)
98 if _product_id and _product_id.sale_enabled \
99 and _partner_id and _partner_id.sale_prices:
100 _price = _product_id.sale_price
101 _line[2]['price_unit'] = round(_price, _dp)
102 elif pricelist:
92 _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],103 _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
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, {
94 'uom': _line[2]['product_uom'] or result.get('product_uom'),105 'uom': _line[2]['product_uom'] or result.get('product_uom'),
@@ -101,7 +112,12 @@
101 lines = []112 lines = []
102 for _order in self.browse(cr, uid, ids, context):113 for _order in self.browse(cr, uid, ids, context):
103 for _line in _order.order_line:114 for _line in _order.order_line:
104 if pricelist:115 if _line.product_id.sale_enabled and _partner_id.sale_prices:
116 _price = _line.product_id.sale_price
117 res = {'price_unit': round(_price, _dp),
118 'price_subtotal': False}
119 lines.append((1, _line.id, res))
120 elif pricelist:
105 _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],121 _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
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, {
107 'uom': _line.product_uom.id or result.get('product_uom'),123 'uom': _line.product_uom.id or result.get('product_uom'),
@@ -177,10 +193,21 @@
177193
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):
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')
180 _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product, uom_quantity or 1.0, partner,196
181 {'uom': uom or result.get('uom'),197 _partner_id = False
182 'date': date_order}198 _product_id = False
183 )[pricelist] or 0.0199 if partner and product:
200 _partner_id = self.pool.get('res.partner').browse(cr, uid, partner, None)
201 _product_id = self.pool.get('product.product').browse(cr, uid, product, None)
202
203 if _product_id and _product_id.sale_enabled \
204 and _partner_id and _partner_id.sale_prices:
205 _price = _product_id.sale_price
206 else:
207 _price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product, uom_quantity or 1.0, partner,
208 {'uom': uom or result.get('uom'),
209 'date': date_order}
210 )[pricelist] or 0.0
184 return _price211 return _price
185212
186sale_order()213sale_order()

Subscribers

People subscribed via source and target branches