← Back to team overview

openerp-dev-web team mailing list archive

lp:~openerp-dev/openobject-addons/trunk-rework-addons-23-march-aag into lp:~openerp-dev/openobject-addons/trunk-configuration-rework

 

Atik Agewan(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-rework-addons-23-march-aag into lp:~openerp-dev/openobject-addons/trunk-configuration-rework.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-rework-addons-23-march-aag/+merge/56689

Rework Config Wiz of sale,product 
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-rework-addons-23-march-aag/+merge/56689
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-configuration-rework.
=== modified file 'product/__openerp__.py'
--- product/__openerp__.py	2011-03-25 10:24:13 +0000
+++ product/__openerp__.py	2011-04-07 05:20:50 +0000
@@ -55,6 +55,7 @@
         'product_data.xml',
         'product_report.xml',
         'product_view.xml',
+        'wizard/res_product_installer.xml',
         'product_shortcut_data.xml',
         'pricelist_view.xml',
         'partner_view.xml',

=== modified file 'product/wizard/__init__.py'
--- product/wizard/__init__.py	2011-01-14 00:11:01 +0000
+++ product/wizard/__init__.py	2011-04-07 05:20:50 +0000
@@ -19,6 +19,7 @@
 #
 ##############################################################################
 import product_price
+import res_product_installer
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 

=== added file 'product/wizard/res_product_installer.py'
--- product/wizard/res_product_installer.py	1970-01-01 00:00:00 +0000
+++ product/wizard/res_product_installer.py	2011-04-07 05:20:50 +0000
@@ -0,0 +1,54 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+import pooler
+
+class res_product_installer(osv.osv_memory):
+    _name = 'res.product.installer'
+    _inherit = 'res.config'
+    _columns = {
+    }
+    _defaults = {
+    }
+    
+    def execute(self, cr, uid, ids, context=None):
+        if context is None:
+             context = {}
+        data_obj = self.pool.get('ir.model.data')
+        id2 = data_obj._get_id(cr, uid, 'product', 'product_normal_form_view')
+        if id2:
+            id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+        return {
+                'view_type': 'form',
+                'view_mode': 'form',
+                'res_model': 'product.product',
+                'views': [(id2, 'form')],
+#                'view_id': False,
+                'type': 'ir.actions.act_window',
+                'target': 'new',
+                'nodestroy':True,
+            }
+
+res_product_installer()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+

=== added file 'product/wizard/res_product_installer.xml'
--- product/wizard/res_product_installer.xml	1970-01-01 00:00:00 +0000
+++ product/wizard/res_product_installer.xml	2011-04-07 05:20:50 +0000
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- configartion view -->
+<!---->
+<!--        <record id="view_res_product_installer" model="ir.ui.view">-->
+<!--            <field name="name">Configure Product</field>-->
+<!--            <field name="model">res.product.installer</field>-->
+<!--            <field name="type">form</field>-->
+<!--            <field name="inherit_id" ref="base.res_config_view_base"/>-->
+<!--            <field name="arch" type="xml">-->
+<!--              <data>-->
+<!--                <form position="attributes">-->
+<!--                  <attribute name="string">Product Application Configuration</attribute>-->
+<!--                </form>-->
+<!--                <separator string="title" position="attributes">-->
+<!--                <attribute name="string">Configure Product</attribute>-->
+<!--                  </separator>-->
+<!--                <xpath expr='//separator[@string="vsep"]' position='attributes'>-->
+<!--                      <attribute name='rowspan'>15</attribute>-->
+<!--                      <attribute name='string'></attribute>-->
+<!--                  </xpath>-->
+<!--                <xpath expr='//button[@name="action_skip"]' position='replace'/>-->
+<!--              </data>-->
+<!--            </field>-->
+<!--        </record>-->
+<!---->
+<!--        <record id="action_view_res_product_installer" model="ir.actions.act_window">-->
+<!--            <field name="name">Configure Product</field>-->
+<!--            <field name="type">ir.actions.act_window</field>-->
+<!--            <field name="res_model">res.product.installer</field>-->
+<!--            <field name="view_id" ref="view_res_product_installer"/>-->
+<!--            <field name="view_type">form</field>-->
+<!--            <field name="view_mode">form</field>-->
+<!--            <field name="target">new</field>-->
+<!--        </record>-->
+<!---->
+<!--         register configuration wizard -->
+<!--        <record id="config_wizard_res_product_installer" model="ir.actions.todo">-->
+<!--            <field name="action_id" ref="action_view_res_product_installer"/>-->
+<!--            <field name="restart">on_trigger</field>-->
+<!--        </record>-->
+<!--        -->
+
+         <record id="product_form_config_action" model="ir.actions.act_window">
+            <field name="name">Create some products</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">product.product</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="product.product_normal_form_view"/>
+        </record>
+        
+         <!--      register configuration wizard -->
+        <record id="config_wizard_res_product_installer" model="ir.actions.todo">
+            <field name="action_id" ref="product_form_config_action"/>
+            <field name="target">current</field>
+            <field name="restart">never</field>
+            <field name="state">skip</field>
+        </record>
+        
+    </data>
+</openerp>

=== modified file 'sale/sale.py'
--- sale/sale.py	2011-02-22 09:27:33 +0000
+++ sale/sale.py	2011-04-07 05:20:50 +0000
@@ -1177,14 +1177,10 @@
 
     _columns = {
         'name': fields.char('Name', size=64),
-        'picking_policy': fields.selection([
-            ('direct', 'Direct Delivery'),
-            ('one', 'All at Once')
-        ], 'Picking Default Policy', required=True, help="The Shipping Policy is used to configure per order if you want to deliver as soon as possible when one product is available or you wait that all products are available.."),
         'order_policy': fields.selection([
             ('manual', 'Invoice Based on Sales Orders'),
             ('picking', 'Invoice Based on Deliveries'),
-        ], 'Shipping Default Policy', required=True,
+        ], 'Invoice Method', required=True,
            help="You can generate invoices based on sales orders or based on shippings."),
         'step': fields.selection([
             ('one', 'Delivery Order Only'),
@@ -1196,7 +1192,6 @@
            "in one or two operations by the worker.")
     }
     _defaults = {
-        'picking_policy': 'direct',
         'order_policy': 'manual',
         'step': 'one'
     }
@@ -1204,7 +1199,6 @@
     def execute(self, cr, uid, ids, context=None):
         for o in self.browse(cr, uid, ids, context=context):
             ir_values_obj = self.pool.get('ir.values')
-            ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], o.picking_policy)
             ir_values_obj.set(cr, uid, 'default', False, 'order_policy', ['sale.order'], o.order_policy)
             if o.step == 'two':
                 md = self.pool.get('ir.model.data')

=== modified file 'sale/sale_view.xml'
--- sale/sale_view.xml	2011-03-28 15:46:01 +0000
+++ sale/sale_view.xml	2011-04-07 05:20:50 +0000
@@ -545,18 +545,16 @@
                 <attribute name="string">Configure Sales Order Logistics</attribute>
                   </separator>
                   <xpath expr="//label[@string='description']" position="attributes">
-                    <attribute name="string">Setup your sales workflow and default values.</attribute>
+                    <attribute name="string">Define your invoice method. A services company usually invoices based on sale orders while a retailer usually invoices based on deliveries.</attribute>
                   </xpath>
                 <xpath expr='//separator[@string="vsep"]' position='attributes'>
                       <attribute name='rowspan'>15</attribute>
                       <attribute name='string'></attribute>
                   </xpath>
                 <group string="res_config_contents" position="replace">
-                  <field name="picking_policy" groups="base.group_extended"/>
-                  <newline/>
                   <field name="order_policy"/>
                   <newline/>
-                  <field name="step"/>
+                  <field name="step" groups="base.group_extended"/>
                 </group>
                 <xpath expr='//button[@name="action_skip"]' position='replace'/>
               </data>


Follow ups