'string':"Date/Period Filter",
'type':'selection',
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
- 'default': lambda *a:'bydate'
+ 'default': lambda *a:'none'
},
'fiscalyear': {
'string':'Fiscal year',
'help':'Keep empty for all open fiscal year'
},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
- 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With Movements'),('bal_solde','With Balance != 0'),('bal_all','All')]},
- 'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
+ 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
+ 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
+ data['form']['fiscalyear'] = False
data['form']['display_account']='bal_all'
return data['form']
# -*- encoding: utf-8 -*-
##############################################################################
#
-# OpenERP, Open Source Management Solution
+# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
'close_move': lambda *a: 0,
'procure_method': lambda *a: 'make_to_order',
}
+
+ def unlink(self, cr, uid, ids):
+ procurements = self.read(cr, uid, ids, ['state'])
+ unlink_ids = []
+ for s in procurements:
+ if s['state'] in ['draft','cancel']:
+ unlink_ids.append(s['id'])
+ else:
+ raise osv.except_osv(_('Invalid action !'), _('Cannot delete Procurement Order(s) which are in %s State!' % s['state']))
+ osv.osv.unlink(self, cr, uid, unlink_ids)
+ return True
+
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
if product_id:
w=self.pool.get('product.product').browse(cr,uid,product_id, context)
# Explode picking by replacing phantom BoMs
#
def action_explode(self, cr, uid, picks, *args):
- for move in picks:
+ for move in self.pool.get('stock.move').browse(cr, uid, picks):
self.pool.get('stock.move')._action_explode(cr, uid, move)
return picks