[MERGE] branch merged with lp:~openerp-dev/openobject-addons/mtr-dev-addons1
authormso <mso@mso>
Thu, 13 May 2010 11:11:27 +0000 (16:41 +0530)
committermso <mso@mso>
Thu, 13 May 2010 11:11:27 +0000 (16:41 +0530)
bzr revid: mso@mso-20100513111127-dzs3jj00sqrbikj5

1  2 
addons/mrp_procurement/mrp_procurement_view.xml
addons/stock/wizard/stock_replacement.py
addons/stock/wizard/stock_ups.py

@@@ -85,7 -85,7 +85,7 @@@
              <field name="arch" type="xml">
                  <search string="Search Procurement">
                      <group col='10' colspan='4'>
--                       <filter icon="terp-mrp" string="Current" domain="[('state','in',('draft','confirmed'))]" default="1" help="Procurement Orders in draft or open state."/>
++                       <filter icon="terp-mrp" string="Current" domain="[('state','in',('draft','confirmed'))]" name="current" help="Procurement Orders in draft or open state."/>
                         <filter icon="terp-mrp" string="Exceptions" domain="[('state','=','exception')]" help="Procurement Orders with exceptions"/>
                         <filter icon="terp-mrp" string="Late"
                             domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]"
              <field name="res_model">mrp.procurement</field>
              <field name="view_type">form</field>
              <field name="view_id" eval="False"/>
++            <field name="context">{'search_default_current':1}</field>
              <field name="search_view_id" ref="view_mrp_procurement_filter"/>
          </record>
  
index 0000000,e753206..a6f3921
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,68 +1,68 @@@
+ # -*- 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
+ from service import web_services
+ from tools.translate import _
+ import netsvc
+ import pooler
+ import time
+ import wizard
+ class stock_replacement(osv.osv_memory):
+     """
+         This class has been defined for replacement wizard
+     """
+     _name = "stock.replacement"
+     _description = "Stock Replacement"
 -    def get_composant(self, cr, uid, ids, context):
++    def get_composant(self, cr, uid, ids, context = {}):
+         return {}
 -    def replace_composant(self, cr, uid, ids, context):
++    def replace_composant(self, cr, uid, ids, context = {}):
+         """ 
+            to open a new wizard that acknowledge, a replacement task 
+             
+            @return: it returns the replacement acknowledgement form
+         
+         """                
+         return {
+                     'name': False, 
+                     'view_type': 'form', 
+                     'view_mode': 'form', 
+                     'res_model': 'stock.replacement.result', 
+                     'type': 'ir.actions.act_window', 
+                     'target':'new',
+             }
+ stock_replacement()
+ class stock_replacement_result(osv.osv_memory):
+     """
+         This class has been defined for replacement result 
+     """
+     _name = "stock.replacement.result"
+     _description = "Stock Replacement result"
+ stock_replacement_result()
+ # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 0000000,ad6e157..5bde686
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,91 +1,91 @@@
+ # -*- 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
+ from service import web_services
+ from tools.translate import _
+ import netsvc
+ import pooler
+ import time
+ import wizard
+ class stock_ups(osv.osv_memory):
+     _name = "stock.ups"
+     _description = "Stock ups"
 -    def ups_save(self, cr, uid, ids, context):
++    def ups_save(self, cr, uid, ids, context = {}):
+        
+         return {
+                     'name': False, 
+                     'view_type': 'form', 
+                     'view_mode': 'form', 
+                     'res_model': 'stock.ups.final', 
+                     'type': 'ir.actions.act_window', 
+                     'target':'new',
+             }
 -    def ups_upload(self, cr, uid, ids, context):
++    def ups_upload(self, cr, uid, ids, context = {}):
+          
+         return {
+                     'name': False, 
+                     'view_type': 'form', 
+                     'view_mode': 'form', 
+                     'res_model': 'stock.ups.upload', 
+                     'type': 'ir.actions.act_window', 
+                     'target':'new',
+             }
+     _columns = {
+         'weight': fields.float('Lot weight', required=True), 
+     }
+     _defaults = {
+         'weight': lambda *a: 3.0,
+     }
+ stock_ups()
+ class stock_ups_final(osv.osv_memory):
+     _name = "stock.ups.final"
+     _description = "Stock ups final"
 -#    def create_xmlfile(self, cr, uid, ids, context):
 -#        report = netsvc._group['report']['report.stock.move.lot.ups_xml']
 -#        data['report_type'] = 'raw'
 -#        return {'xmlfile' : report.create(uid, context['active_id'], ids, {})}
++    def create_xmlfile(self, cr, uid, ids, context = {}):
++        report = netsvc._group['report']['report.stock.move.lot.ups_xml']
++        data['report_type'] = 'raw'
++        return {'xmlfile' : report.create(uid, context['active_id'], ids, {})}
+     _columns = {
+         'xmlfile': fields.binary('XML File'), 
+     }
+ stock_ups_final()
+ class stock_ups_upload(osv.osv_memory):
+     _name = "stock.ups.upload"
+     _description = "Stock ups upload"
 -    def upload_xmlfile(self, cr, uid, ids, context):
 -#        report = netsvc._group['report']['report.stock.move.lot.ups_xml']
 -#        data['report_type'] = 'raw'
++    def upload_xmlfile(self, cr, uid, ids, context = {}):
++        report = netsvc._group['report']['report.stock.move.lot.ups_xml']
++        data['report_type'] = 'raw'
+ #FIXME: this seems unfinished   
 -#        fp = file('/tmp/test.xml', 'w').write(report.create(uid, context['active_id'], ids, {}))
++        fp = file('/tmp/test.xml', 'w').write(report.create(uid, context['active_id'], ids, {}))
+         return {}
+ stock_ups_upload()
+ # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: