<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="['&', ('date_planned::date','<', 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>
--- /dev/null
+ # -*- 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:
+
--- /dev/null
+ # -*- 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:
+