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
6898ade4
Commit
6898ade4
authored
11 years ago
by
Quentin De Paoli
Browse files
Options
Downloads
Patches
Plain Diff
[WIP] stock_account
bzr revid: qdp-launchpad@openerp.com-20130715112219-o1bh3hipzxpxrtw9
parent
ea588864
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
addons/sale_stock/__openerp__.py
+1
-1
1 addition, 1 deletion
addons/sale_stock/__openerp__.py
addons/stock_account/product.py
+1
-1
1 addition, 1 deletion
addons/stock_account/product.py
addons/stock_account/stock_account.py
+12
-12
12 additions, 12 deletions
addons/stock_account/stock_account.py
with
14 additions
and
14 deletions
addons/sale_stock/__openerp__.py
+
1
−
1
View file @
6898ade4
...
...
@@ -45,7 +45,7 @@ You can choose flexible invoicing methods:
'
author
'
:
'
OpenERP SA
'
,
'
website
'
:
'
http://www.openerp.com
'
,
'
images
'
:
[
'
images/deliveries_to_invoice.jpeg
'
],
'
depends
'
:
[
'
sale
'
,
'
stock
'
,
'
procurement
'
],
'
depends
'
:
[
'
sale
'
,
'
stock
_account
'
,
'
procurement
'
],
'
init_xml
'
:
[],
'
update_xml
'
:
[
'
security/sale_stock_security.xml
'
,
'
security/ir.model.access.csv
'
,
...
...
This diff is collapsed.
Click to expand it.
addons/stock_account/product.py
+
1
−
1
View file @
6898ade4
...
...
@@ -186,7 +186,7 @@ class product_template(osv.osv):
'
cost_method
'
:
fields
.
property
(
type
=
'
selection
'
,
selection
=
[(
'
standard
'
,
'
Standard Price
'
),
(
'
average
'
,
'
Average Price
'
),
(
'
real
'
,
'
Real Price
'
)],
help
=
"""
Standard Price: The cost price is manually updated at the end of a specific period (usually every year)
Average Price: The cost price is recomputed at each incoming shipment
Real Price: The cost price is calculated as the real price of
the last
outgoing
shipmen
t
"""
,
Real Price: The cost price is calculated as the real price of
each
outgoing
produc
t
"""
,
string
=
"
Costing Method
"
,
required
=
True
),
'
property_stock_account_input
'
:
fields
.
property
(
type
=
'
many2one
'
,
...
...
This diff is collapsed.
Click to expand it.
addons/stock_account/stock_account.py
+
12
−
12
View file @
6898ade4
...
...
@@ -73,7 +73,7 @@ class stock_quant(osv.osv):
location_from: can be None if it
'
s a new quant
"""
def
_account_entry_move
(
self
,
cr
,
uid
,
quant
,
location_from
,
location_to
,
move
,
context
=
None
):
if
quant
.
product_id
.
valuation
<>
'
realtime
'
:
if
quant
.
product_id
.
valuation
<>
'
real
_
time
'
:
return
False
company_from
=
self
.
_location_owner
(
cr
,
uid
,
quant
,
location_from
,
context
=
context
)
company_to
=
self
.
_location_owner
(
cr
,
uid
,
quant
,
location_to
,
context
=
context
)
...
...
@@ -84,24 +84,24 @@ class stock_quant(osv.osv):
account_moves
=
[]
# Create Journal Entry for products arriving in the company
if
company_to
:
if
location_from
.
usage
==
'
customer
'
:
if
location_from
and
location_from
.
usage
==
'
customer
'
:
#goods returned from customer
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
acc_dest
,
acc_valuation
,
context
=
context
)
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
move
,
acc_dest
,
acc_valuation
,
context
=
context
)
else
:
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
acc_src
,
acc_valuation
,
context
=
context
)
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
move
,
acc_src
,
acc_valuation
,
context
=
context
)
# Create Journal Entry for products leaving the company
if
company_from
:
if
location_to
.
usage
==
'
supplier
'
:
if
location_to
and
location_to
.
usage
==
'
supplier
'
:
#goods returned to supplier
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
acc_valuation
,
acc_src
,
context
=
context
)
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
move
,
acc_valuation
,
acc_src
,
context
=
context
)
else
:
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
acc_valuation
,
acc_dest
,
context
=
context
)
account_moves
+=
self
.
_create_account_move_line
(
cr
,
uid
,
quant
,
move
,
acc_valuation
,
acc_dest
,
context
=
context
)
def
move_single_quant
(
self
,
cr
,
uid
,
quant
,
qty
,
move
,
context
=
None
):
location_from
=
quant
and
quant
.
location_id
or
False
quant
=
super
(
stock_quant
,
self
).
move_single_quant
(
cr
,
uid
,
quant
,
qty
,
move
,
context
=
context
)
quant
.
refresh
()
location_from
=
quant
.
location_id
self
.
_account_entry_move
(
cr
,
uid
,
quant
,
location_from
,
quant
.
location_id
,
move
,
context
=
context
)
return
quant
...
...
@@ -263,8 +263,8 @@ class stock_quant(osv.osv):
debit_line_vals
=
{
'
name
'
:
move
.
name
,
'
product_id
'
:
quant
.
product_id
.
id
,
'
quantity
'
:
quant
.
product_
qty
,
'
product_uom_id
'
:
quant
.
product_id
.
product_
uom
.
id
,
'
quantity
'
:
quant
.
qty
,
'
product_uom_id
'
:
quant
.
product_id
.
uom
_id
.
id
,
'
ref
'
:
move
.
picking_id
and
move
.
picking_id
.
name
or
False
,
'
date
'
:
time
.
strftime
(
'
%Y-%m-%d
'
),
'
partner_id
'
:
partner_id
,
...
...
@@ -274,8 +274,8 @@ class stock_quant(osv.osv):
credit_line_vals
=
{
'
name
'
:
move
.
name
,
'
product_id
'
:
quant
.
product_id
.
id
,
'
quantity
'
:
quant
.
product_
qty
,
'
product_uom_id
'
:
quant
.
product_id
.
product_
uom
.
id
,
'
quantity
'
:
quant
.
qty
,
'
product_uom_id
'
:
quant
.
product_id
.
uom
_id
.
id
,
'
ref
'
:
move
.
picking_id
and
move
.
picking_id
.
name
or
False
,
'
date
'
:
time
.
strftime
(
'
%Y-%m-%d
'
),
'
partner_id
'
:
partner_id
,
...
...
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