[IMP] product:wizard_price.py[old file] has been added and converted the wizard into...
authormso <mso@mso>
Thu, 4 Mar 2010 11:07:26 +0000 (16:37 +0530)
committermso <mso@mso>
Thu, 4 Mar 2010 11:07:26 +0000 (16:37 +0530)
bzr revid: mso@mso-20100304110726-0yzgh3nt271qbe4y

addons/product/product_wizard.xml
addons/product/wizard/product_price_list.py
addons/product/wizard/product_price_list_view.xml
addons/product/wizard/wizard_price.py [new file with mode: 0644]

index f226cd4..77c65a8 100644 (file)
@@ -1,11 +1,13 @@
 <?xml version="1.0" ?>
 <openerp>
        <data>
+<!--
        <wizard
                         id="report_wizard_price"
                         string="Price List"
                         model="product.product"
                         name="product.price_list"
                         keyword="client_print_multi"/>
+-->    
        </data>
 </openerp>
index 12c810b..9e39b00 100644 (file)
 #
 ##############################################################################
 
+from osv import fields, osv
+from service import web_services
+import time
 import wizard
-
-qty1_form = '''<?xml version="1.0"?>
-<form string="Price list">
-    <field name="price_list" />
-    <field name="qty1" colspan="2" />
-    <field name="qty2" colspan="2" />
-    <field name="qty3" colspan="2" />
-    <field name="qty4" colspan="2" />
-    <field name="qty5" colspan="2" />
-
-</form>'''
-qty1_fields = {
-        'price_list' : {'string' : 'PriceList', 'type' : 'many2one', 'relation' : 'product.pricelist', 'required':True },
-        'qty1': {'string':'Quantity-1', 'type':'integer', 'default':0},
-        'qty2': {'string':'Quantity-2', 'type':'integer', 'default':0},
-        'qty3': {'string':'Quantity-3', 'type':'integer', 'default':0},
-        'qty4': {'string':'Quantity-4', 'type':'integer', 'default':0},
-        'qty5': {'string':'Quantity-5', 'type':'integer', 'default':0},
+import pooler
+
+class product_price_list(osv.osv_memory):
+    _name = "product.price.list"
+    _description = "Product Price List"
+
+    _columns = {
+        'price_list': fields.many2one('product.pricelist', 'PriceList', required=True), 
+        'qty1':fields.integer('Quantity-1'),
+       'qty2':fields.integer('Quantity-2'),
+        'qty3':fields.integer('Quantity-3'),
+        'qty4':fields.integer('Quantity-4'),
+        'qty5':fields.integer('Quantity-5'),
 }
 
-
-class wizard_qty(wizard.interface):
-
-    states = {
-        'init': {
-            'actions': [],
-            'result': {'type':'form', 'arch':qty1_form, 'fields':qty1_fields, 'state':[('end','Cancel'),('price','Print')]}
-        },
-        'price': {
-            'actions': [],
-            'result': {'type':'print', 'report':'product.pricelist', 'state':'end'}
-        }
-
-    }
-wizard_qty('product.price_list')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+    _defaults = {
+        'qty1': lambda *a:'0',
+       'qty2': lambda * a:'0',
+       'qty3': lambda *a:'0',
+       'qty4': lambda *a:'0',
+       'qty5': lambda *a:'0',
+     }
+product_price_list()
 
index 5463b88..370e04f 100644 (file)
@@ -1,35 +1,35 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
-    <data>
-       <record id="view_product_price_view" model="ir.ui.view">
-            <field name="name">Price list</field>
-            <field name="model">product.price.list</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-              <form string="Price list">
-                <field name="price_list" colspan="2" />
-                <field name="qty1" colspan="2" />
-                <field name="qty2" colspan="2" />
-                <field name="qty3" colspan="2" />
-                <field name="qty4" colspan="2" />
-                <field name="qty5" colspan="2" />
-                  <separator string="" colspan="4" />
-                    <label string="" colspan="2" />
-                      <button special="cancel" string="Cancel" />
-                      <button string="Print" type="object"/> 
-             </form>
-           </field>
-       </record>
+       <data>
+               <record id="view_product_price_view" model="ir.ui.view">
+                       <field name="name">Price list</field>
+                       <field name="model">product.price.list</field>
+                       <field name="type">form</field>
+                       <field name="arch" type="xml">
+                               <form string="Price list">
+                                       <field name="price_list" colspan="2" />
+                                       <field name="qty1" colspan="2" />
+                                       <field name="qty2" colspan="2" />
+                                       <field name="qty3" colspan="2" />
+                                       <field name="qty4" colspan="2" />
+                                       <field name="qty5" colspan="2" />
+                                       <separator string="" colspan="4" />
+                                       <label string="" colspan="2" />
+                                       <button special="cancel" string="Cancel" />
+                                       <button string="Print" type="object"/> 
+                               </form>
+                       </field>
+               </record>
        
-       <record id="action_product_price_view" model="ir.actions.act_window">
-            <field name="name">Price List </field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">product.price.list</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">form</field>
-            <field name="target">new</field>
-           <field name="view_id" ref="view_product_price_view"/>
-        </record>
+               <record id="action_product_price_view" model="ir.actions.act_window">
+                       <field name="name">Price List </field>
+                       <field name="type">ir.actions.act_window</field>
+                       <field name="res_model">product.price.list</field>
+                       <field name="view_type">form</field>
+                       <field name="view_mode">form</field>
+                       <field name="target">new</field>
+                       <field name="view_id" ref="view_product_price_view"/>
+               </record>
 
     </data>
 </openerp>
diff --git a/addons/product/wizard/wizard_price.py b/addons/product/wizard/wizard_price.py
new file mode 100644 (file)
index 0000000..12c810b
--- /dev/null
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#    
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
+#
+##############################################################################
+
+import wizard
+
+qty1_form = '''<?xml version="1.0"?>
+<form string="Price list">
+    <field name="price_list" />
+    <field name="qty1" colspan="2" />
+    <field name="qty2" colspan="2" />
+    <field name="qty3" colspan="2" />
+    <field name="qty4" colspan="2" />
+    <field name="qty5" colspan="2" />
+
+</form>'''
+qty1_fields = {
+        'price_list' : {'string' : 'PriceList', 'type' : 'many2one', 'relation' : 'product.pricelist', 'required':True },
+        'qty1': {'string':'Quantity-1', 'type':'integer', 'default':0},
+        'qty2': {'string':'Quantity-2', 'type':'integer', 'default':0},
+        'qty3': {'string':'Quantity-3', 'type':'integer', 'default':0},
+        'qty4': {'string':'Quantity-4', 'type':'integer', 'default':0},
+        'qty5': {'string':'Quantity-5', 'type':'integer', 'default':0},
+}
+
+
+class wizard_qty(wizard.interface):
+
+    states = {
+        'init': {
+            'actions': [],
+            'result': {'type':'form', 'arch':qty1_form, 'fields':qty1_fields, 'state':[('end','Cancel'),('price','Print')]}
+        },
+        'price': {
+            'actions': [],
+            'result': {'type':'print', 'report':'product.pricelist', 'state':'end'}
+        }
+
+    }
+wizard_qty('product.price_list')
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+