bzr revid: fp@tinyerp.com-20101012093745-kpfyjls7h8ftczjm
This commit is contained in:
Fabien Pinckaers 2010-10-12 11:37:45 +02:00
parent 852979228b
commit bac3fe249a
2 changed files with 14 additions and 13 deletions

View File

@ -31,8 +31,9 @@
"access_account_sequence_fiscalyear_purchase_user","account.sequence.fiscalyear purchase","account.model_account_sequence_fiscalyear","group_purchase_user",1,1,1,1
"access_res_partner_purchase_user","res.partner purchase","base.model_res_partner","group_purchase_user",1,0,0,0
"access_res_partner_address_purchase_user","res.partner.address purchase","base.model_res_partner_address","group_purchase_user",1,0,0,0
"access_account_journal","account.journal","account.model_account_journal","group_purchase_user",1,1,1,0
"access_account_journal_manager","account.journal","account.model_account_journal","group_purchase_manager",1,1,1,1
"access_account_journal_period","account.journal.period","account.model_account_journal_period","group_purchase_user",1,1,1,0
"access_account_journal","account.journal","account.model_account_journal","group_purchase_user",1,0,0,0
"access_account_journal_manager","account.journal","account.model_account_journal","group_purchase_manager",1,0,0,0
"access_account_period","account.period","account.model_account_period","group_purchase_user",1,0,0,0
"access_account_fiscalyear","account.fiscalyear","account.model_account_fiscalyear","group_purchase_user",1,0,0,0
"access_account_move","account.move","account.model_account_move","group_purchase_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
31 access_account_sequence_fiscalyear_purchase_user account.sequence.fiscalyear purchase account.model_account_sequence_fiscalyear group_purchase_user 1 1 1 1
32 access_res_partner_purchase_user res.partner purchase base.model_res_partner group_purchase_user 1 0 0 0
33 access_res_partner_address_purchase_user res.partner.address purchase base.model_res_partner_address group_purchase_user 1 0 0 0
34 access_account_journal access_account_journal_period account.journal account.journal.period account.model_account_journal account.model_account_journal_period group_purchase_user 1 1 1 0
35 access_account_journal_manager access_account_journal account.journal account.model_account_journal group_purchase_manager group_purchase_user 1 1 0 1 0 1 0
36 access_account_journal_manager account.journal account.model_account_journal group_purchase_manager 1 0 0 0
37 access_account_period account.period account.model_account_period group_purchase_user 1 0 0 0
38 access_account_fiscalyear account.fiscalyear account.model_account_fiscalyear group_purchase_user 1 0 0 0
39 access_account_move account.move account.model_account_move group_purchase_user 1 1 1 1

View File

@ -41,14 +41,14 @@ class stock_split_into(osv.osv_memory):
quantity = self.browse(cr, uid, data[0], context).quantity or 0.0
for move in move_obj.browse(cr, uid, rec_id):
quantity_rest = move.product_qty - quantity
if move.tracking_id :
raise osv.except_osv(_('Error!'), _('The current move line is already assigned to a pack, please remove it first if you really want to change it ' \
'for this product: "%s" (id: %d)') % \
(move.product_id.name, move.product_id.id,))
#if move.tracking_id :
# raise osv.except_osv(_('Error!'), _('The current move line is already assigned to a pack, please remove it first if you really want to change it ' \
# 'for this product: "%s" (id: %d)') % \
# (move.product_id.name, move.product_id.id,))
if quantity > move.product_qty:
raise osv.except_osv(_('Error!'), _('Total quantity after split exceeds the quantity to split ' \
'for this product: "%s" (id: %d)') % \
(move.product_id.name, move.product_id.id,))
(move.product_id.name, move.product_id.id,))
if quantity > 0:
move_obj.setlast_tracking(cr, uid, [move.id], context=context)
move_obj.write(cr, uid, [move.id], {
@ -63,12 +63,12 @@ class stock_split_into(osv.osv_memory):
move_obj.write(cr, uid, [move.id], {'tracking_id': tracking_id})
else:
default_val = {
'product_qty': quantity_rest,
'product_uos_qty': quantity_rest,
'tracking_id': tracking_id,
'state': move.state,
'product_uos': move.product_uom.id
}
'product_qty': quantity_rest,
'product_uos_qty': quantity_rest,
'tracking_id': tracking_id,
'state': move.state,
'product_uos': move.product_uom.id
}
move_obj.copy(cr, uid, move.id, default_val)
return {}
stock_split_into()