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

Proposed by Atik Agewan(OpenERP)
Status: Merged
Merged at revision: 13
Proposed branch: lp:~openbig/bigconsulting/wizard_sale_prize_information
Merge into: lp:bigconsulting
Diff against target: 260 lines (+184/-10)
6 files modified
product_ean13_generator/product_ean13_generator_report.xml (+6/-6)
product_price_information/__init__.py (+2/-1)
product_price_information/__terp__.py (+3/-3)
product_price_information/wizard/__init__.py (+26/-0)
product_price_information/wizard/sale_prize_information.py (+85/-0)
product_price_information/wizard/sale_prize_information_view.xml (+62/-0)
To merge this branch: bzr merge lp:~openbig/bigconsulting/wizard_sale_prize_information
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+27135@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product_ean13_generator/product_ean13_generator_report.xml'
2--- product_ean13_generator/product_ean13_generator_report.xml 2010-06-03 10:45:13 +0000
3+++ product_ean13_generator/product_ean13_generator_report.xml 2010-06-09 10:43:23 +0000
4@@ -1,12 +1,12 @@
5 <?xml version="1.0" encoding="utf-8"?>
6 <openerp>
7 <data>
8- <report auto="False"
9- id="report_product_ean_generator"
10- model="product.product"
11- name="ean.generator"
12- rml="product_ean13_generator/report/product_ean_generator_report.rml"
13- string="EAN13 Report"
14+ <report auto="False"
15+ id="report_product_ean_generator"
16+ model="product.product"
17+ name="ean.generator"
18+ rml="product_ean13_generator/report/product_ean_generator_report.rml"
19+ string="EAN13 Report"
20 header="False"/>
21 </data>
22 </openerp>
23
24=== modified file 'product_price_information/__init__.py'
25--- product_price_information/__init__.py 2010-05-17 14:50:10 +0000
26+++ product_price_information/__init__.py 2010-06-09 10:43:23 +0000
27@@ -1,7 +1,7 @@
28 # -*- encoding: utf-8 -*-
29 ##############################################################################
30 #
31-# OpenERP, Open Source Management Solution
32+# OpenERP, Open Source Management Solution
33 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
34 # $Id$
35 #
36@@ -21,6 +21,7 @@
37 ##############################################################################
38
39 import product_price_info
40+import wizard
41
42 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
43
44
45=== modified file 'product_price_information/__terp__.py'
46--- product_price_information/__terp__.py 2010-05-28 10:52:25 +0000
47+++ product_price_information/__terp__.py 2010-06-09 10:43:23 +0000
48@@ -1,7 +1,7 @@
49 # -*- encoding: utf-8 -*-
50 ##############################################################################
51 #
52-# OpenERP, Open Source Management Solution
53+# OpenERP, Open Source Management Solution
54 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
55 # $Id$
56 #
57@@ -27,11 +27,11 @@
58 "category": "Generic Modules/Sales & Purchases",
59 "description": """This module will add shop price field on sale order line
60 and product view called from sale order line. Shop Price will display product price
61- based on pricelist defined in shop selected in sale order.
62+ based on pricelist defined in shop selected in sale order.
63 """,
64 "depends": ['product_tax_include','sale_tax_include'],
65 "demo_xml": [],
66- "update_xml": ['product_price_info_view.xml' ],
67+ "update_xml": ['product_price_info_view.xml','wizard/sale_prize_information_view.xml'],
68 "license": "GPL-3",
69 "active": False,
70 "installable": True,
71
72=== added directory 'product_price_information/wizard'
73=== added file 'product_price_information/wizard/__init__.py'
74--- product_price_information/wizard/__init__.py 1970-01-01 00:00:00 +0000
75+++ product_price_information/wizard/__init__.py 2010-06-09 10:43:23 +0000
76@@ -0,0 +1,26 @@
77+# -*- coding: utf-8 -*-
78+##############################################################################
79+#
80+# OpenERP, Open Source Management Solution
81+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
82+#
83+# This program is free software: you can redistribute it and/or modify
84+# it under the terms of the GNU Affero General Public License as
85+# published by the Free Software Foundation, either version 3 of the
86+# License, or (at your option) any later version.
87+#
88+# This program is distributed in the hope that it will be useful,
89+# but WITHOUT ANY WARRANTY; without even the implied warranty of
90+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91+# GNU Affero General Public License for more details.
92+#
93+# You should have received a copy of the GNU Affero General Public License
94+# along with this program. If not, see <http://www.gnu.org/licenses/>.
95+#
96+##############################################################################
97+
98+import sale_prize_information
99+
100+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
101+
102+
103
104=== added file 'product_price_information/wizard/sale_prize_information.py'
105--- product_price_information/wizard/sale_prize_information.py 1970-01-01 00:00:00 +0000
106+++ product_price_information/wizard/sale_prize_information.py 2010-06-09 10:43:23 +0000
107@@ -0,0 +1,85 @@
108+# -*- coding: utf-8 -*-
109+##############################################################################
110+#
111+# OpenERP, Open Source Management Solution
112+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
113+#
114+# This program is free software: you can redistribute it and/or modify
115+# it under the terms of the GNU Affero General Public License as
116+# published by the Free Software Foundation, either version 3 of the
117+# License, or (at your option) any later version.
118+#
119+# This program is distributed in the hope that it will be useful,
120+# but WITHOUT ANY WARRANTY; without even the implied warranty of
121+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
122+# GNU Affero General Public License for more details.
123+#
124+# You should have received a copy of the GNU Affero General Public License
125+# along with this program. If not, see <http://www.gnu.org/licenses/>.
126+#
127+##############################################################################
128+
129+from osv import osv, fields
130+
131+class sale_prize_information(osv.osv_memory):
132+ _name = 'sale.prize.information'
133+ _description = 'Sale Prize Information'
134+ _columns = {
135+ 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist',required= True),
136+ 'partner_id': fields.many2one('res.partner', 'Customer',required= True),
137+ 'product_id': fields.many2one('product.product', 'Product',required= True),
138+ 'quantity1': fields.float('Quantity1'),
139+ 'quantity2': fields.float('Quantity2'),
140+ 'customer_prices1':fields.float('Costomer Prices'),
141+ 'customer_prices2':fields.float('Costomer Prices'),
142+ 'last_customer_prices':fields.float('Last Costomer Prices'),
143+ 'list_prices1':fields.float('List Prices'),
144+ 'list_prices2':fields.float('List Prices'),
145+ 'last_list_prices':fields.float('Last List Prices'),
146+ 'next_better_price_qty':fields.float('Next Better Price Qty'),
147+ 'best_price_on_qty':fields.float('Best Price On Quantity'),
148+ 'qty_buyed':fields.float('Quantity Buyed'),
149+ }
150+ _defaults = {
151+ 'quantity1': lambda *a: 1.0,
152+ 'quantity2': lambda *a: 5.0,
153+
154+ }
155+
156+ def set_default(self, cr, uid, ids, context=None):
157+ obj = self.pool.get('product.pricelist')
158+ obj2 = self.pool.get('product.pricelist.item')
159+ form = self.read(cr, uid, ids, [])[0]
160+ partner = form['partner_id']
161+ pricelist = form['pricelist_id']
162+ product = form['product_id']
163+ qty1 = form['quantity1']
164+ qty2 = form['quantity2']
165+ val1 = obj.price_get(cr, uid, ids, product, qty1, partner)
166+ for key,values in val1.items():
167+ c_price1 = values
168+ val2 = obj.price_get(cr, uid, ids, product, qty2, partner)
169+ for key,values in val2.items():
170+ c_price2 = values
171+ item_line = obj2.search(cr,uid,[])
172+ list = []
173+ for line in obj2.browse(cr, uid,item_line, context=context):
174+ if product == line.product_id.id:
175+ list.append(line.min_quantity)
176+ m_qty = max(list)
177+ val3 = obj.price_get(cr, uid, ids, product, m_qty, partner)
178+ for key,values in val3.items():
179+ c_price3 = values
180+ self.write(cr , uid, ids,{'customer_prices1':c_price1,'customer_prices2':c_price2,'next_better_price_qty':m_qty,'best_price_on_qty':c_price3},context=context)
181+ value = {
182+
183+ 'name': 'Sale Prize Information',
184+ 'view_type': 'form',
185+ 'view_mode': 'tree,form',
186+ 'res_model': 'sale.prize.information',
187+ 'type': 'ir.actions.act_window',
188+ }
189+
190+sale_prize_information()
191+
192+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
193
194=== added file 'product_price_information/wizard/sale_prize_information_view.xml'
195--- product_price_information/wizard/sale_prize_information_view.xml 1970-01-01 00:00:00 +0000
196+++ product_price_information/wizard/sale_prize_information_view.xml 2010-06-09 10:43:23 +0000
197@@ -0,0 +1,62 @@
198+<?xml version="1.0" encoding="utf-8"?>
199+<openerp>
200+ <data>
201+ <record id="view_sale_prize_information" model="ir.ui.view">
202+ <field name="name">Sale Prize Information</field>
203+ <field name="model">sale.prize.information</field>
204+ <field name="type">form</field>
205+ <field name="arch" type="xml">
206+ <form string="Sale Prize Information">
207+ <group col="6" colspan="4">
208+ <group col="2" colspan="3">
209+ <field name="partner_id"/>
210+ <field name="product_id"/>
211+ <separator string="Prices of Product"/>
212+ <newline/>
213+ <group col="4" colspan="2">
214+ <field name="customer_prices1"/>
215+ <field name="customer_prices2" string=""/>
216+ <field name="list_prices1"/>
217+ <field name="list_prices2" string=""/>
218+ </group>
219+ <field name="next_better_price_qty"/>
220+ <field name="best_price_on_qty"/>
221+ <newline/>
222+ </group>
223+ <group col="2" colspan="3">
224+ <field name="pricelist_id"/>
225+ <group col="4" colspan="2">
226+ <field name="quantity1"/>
227+ <field name="quantity2"/>
228+ </group>
229+ <separator string="Price on Last Sale"/>
230+ <newline/>
231+ <field name="last_customer_prices"/>
232+ <field name="last_list_prices"/>
233+ <field name="qty_buyed"/>
234+ </group>
235+ </group>
236+ <group col="2" colspan="4">
237+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
238+ <button icon="gtk-ok" string="Calculate" name="set_default" type="object" />
239+ </group>
240+ </form>
241+ </field>
242+ </record>
243+
244+ <record id="action_sale_prize_information" model="ir.actions.act_window">
245+ <field name="name">Sale Prize Information</field>
246+ <field name="type">ir.actions.act_window</field>
247+ <field name="res_model">sale.prize.information</field>
248+ <field name="view_type">form</field>
249+ <field name="view_mode">form</field>
250+ <field name="view_id" ref="view_sale_prize_information"/>
251+ <field name="target">new</field>
252+ </record>
253+
254+ <menuitem action="action_sale_prize_information"
255+ id="menu_sale_prize_information"
256+ parent="sale.menu_sale_root"/>
257+
258+ </data>
259+</openerp>
260\ No newline at end of file

Subscribers

People subscribed via source and target branches