[FIX] stock, stock_account: access rights

bzr revid: qdp-launchpad@openerp.com-20131015123028-ku9u0fopcb1wgfii
This commit is contained in:
Quentin (OpenERP) 2013-10-15 14:30:28 +02:00
parent 3f6875c815
commit 94faa4ae11
2 changed files with 6 additions and 3 deletions

View File

@ -50,3 +50,4 @@ access_stock_quant_user,stock.quant user,model_stock_quant,stock.group_stock_use
access_stock_quant_all,stock.quant all users,model_stock_quant,base.group_user,1,0,0,0
access_stock_pack_operation_manager,stock.pack.operation manager,model_stock_pack_operation,stock.group_stock_manager,1,1,1,1
access_stock_pack_operation_user,stock.pack.operation user,model_stock_pack_operation,stock.group_stock_user,1,1,1,1
access_stock_pack_operation_all,stock.pack.operation all users,model_stock_pack_operation,base.group_user,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
50 access_stock_quant_all stock.quant all users model_stock_quant base.group_user 1 0 0 0
51 access_stock_pack_operation_manager stock.pack.operation manager model_stock_pack_operation stock.group_stock_manager 1 1 1 1
52 access_stock_pack_operation_user stock.pack.operation user model_stock_pack_operation stock.group_stock_user 1 1 1 1
53 access_stock_pack_operation_all stock.pack.operation all users model_stock_pack_operation base.group_user 1 0 0 0

View File

@ -23,6 +23,7 @@ import time
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import SUPERUSER_ID
import logging
_logger = logging.getLogger(__name__)
@ -242,7 +243,8 @@ class stock_move(osv.osv):
for q in move.quant_ids:
average_valuation_price += q.qty * q.cost
average_valuation_price = average_valuation_price / move.product_qty
product_obj.write(cr, uid, move.product_id.id, {'standard_price': average_valuation_price}, context=context)
# Write the standard price, as SUPERUSER_ID because a warehouse manager may not have the right to write on products
product_obj.write(cr, SUPERUSER_ID, move.product_id.id, {'standard_price': average_valuation_price}, context=context)
self.write(cr, uid, move.id, {'price_unit': average_valuation_price}, context=context)
def product_price_update_before_done(self, cr, uid, ids, context=None):
@ -260,8 +262,8 @@ class stock_move(osv.osv):
# Get the standard price
amount_unit = product.price_get('standard_price', context=ctx)[product.id]
new_std_price = ((amount_unit * product_avail) + (move.price_unit * move.product_qty)) / (product_avail + move.product_qty)
# Write the field according to price type field
product_obj.write(cr, uid, [product.id], {'standard_price': new_std_price}, context=context)
# Write the standard price, as SUPERUSER_ID because a warehouse manager may not have the right to write on products
product_obj.write(cr, SUPERUSER_ID, [product.id], {'standard_price': new_std_price}, context=context)
def product_price_update_after_done(self, cr, uid, ids, context=None):
'''