merge rpa branch
bzr revid: hmo@tinyerp.com-20081106153123-f924v8mq4faa5ybg
This commit is contained in:
@@ -63,8 +63,8 @@ period_fields = {
|
||||
'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')},
|
||||
}
|
||||
|
||||
|
||||
@@ -771,6 +771,18 @@ class mrp_procurement(osv.osv):
|
||||
'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)
|
||||
|
||||
@@ -198,7 +198,18 @@ class purchase_order(osv.osv):
|
||||
_name = "purchase.order"
|
||||
_description = "Purchase order"
|
||||
_order = "name desc"
|
||||
|
||||
|
||||
def unlink(self, cr, uid, ids):
|
||||
purchase_orders = self.read(cr, uid, ids, ['state'])
|
||||
unlink_ids = []
|
||||
for s in purchase_orders:
|
||||
if s['state'] in ['draft','cancel']:
|
||||
unlink_ids.append(s['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!' % s['state']))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
return True
|
||||
|
||||
def button_dummy(self, cr, uid, ids, context={}):
|
||||
return True
|
||||
|
||||
|
||||
@@ -253,6 +253,17 @@ class sale_order(osv.osv):
|
||||
_order = 'name desc'
|
||||
|
||||
# Form filling
|
||||
def unlink(self, cr, uid, ids):
|
||||
sale_orders = self.read(cr, uid, ids, ['state'])
|
||||
unlink_ids = []
|
||||
for s in sale_orders:
|
||||
if s['state'] in ['draft','canceled']:
|
||||
unlink_ids.append(s['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sale Order(s) which are already confirmed !'))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
return True
|
||||
|
||||
def onchange_shop_id(self, cr, uid, ids, shop_id):
|
||||
v={}
|
||||
if shop_id:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- 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$
|
||||
#
|
||||
@@ -48,8 +48,10 @@ class sale_order(osv.osv):
|
||||
message=False
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, part)
|
||||
if partner.sale_warn:
|
||||
title= "Message",
|
||||
message=partner.sale_warn_msg
|
||||
warning={
|
||||
'title': "Message",
|
||||
'message': partner.sale_warn_msg
|
||||
}
|
||||
|
||||
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part)['value']
|
||||
if result.get('warning',False):
|
||||
@@ -127,7 +129,7 @@ class product_product(osv.osv):
|
||||
'sale_line_warn_msg' : fields.text('Message for Sale Order Line'),
|
||||
'purchase_line_warn' : fields.boolean('Purchase Order Line'),
|
||||
'purchase_line_warn_msg' : fields.text('Message for Purchase Order Line'),
|
||||
}
|
||||
}
|
||||
product_product()
|
||||
|
||||
class sale_order_line(osv.osv):
|
||||
|
||||
Reference in New Issue
Block a user