Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
94faa4ae
Commit
94faa4ae
authored
11 years ago
by
Quentin De Paoli
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] stock, stock_account: access rights
bzr revid: qdp-launchpad@openerp.com-20131015123028-ku9u0fopcb1wgfii
parent
3f6875c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addons/stock/security/ir.model.access.csv
+1
-0
1 addition, 0 deletions
addons/stock/security/ir.model.access.csv
addons/stock_account/stock_account.py
+5
-3
5 additions, 3 deletions
addons/stock_account/stock_account.py
with
6 additions
and
3 deletions
addons/stock/security/ir.model.access.csv
+
1
−
0
View file @
94faa4ae
...
...
@@ -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
This diff is collapsed.
Click to expand it.
addons/stock_account/stock_account.py
+
5
−
3
View file @
94faa4ae
...
...
@@ -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
):
'''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment