Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
4843f36e
Commit
4843f36e
authored
Dec 18, 2018
by
Julien Muchembled
Committed by
Cédric Le Ninivin
May 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not hardcode computation of start/stop dates
Let's use reference_date_method_id on Trade Model Paths.
parent
73cde008
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
36 deletions
+3
-36
bt5/erp5_real_time_inventory_accounting/DocumentTemplateItem/portal_components/document.erp5.InventoryAssetPriceAccountingSimulationRule.py
...ument.erp5.InventoryAssetPriceAccountingSimulationRule.py
+3
-36
No files found.
bt5/erp5_real_time_inventory_accounting/DocumentTemplateItem/portal_components/document.erp5.InventoryAssetPriceAccountingSimulationRule.py
View file @
4843f36e
...
@@ -34,36 +34,6 @@ class InventoryAssetPriceAccountingRuleMovementGenerator(
...
@@ -34,36 +34,6 @@ class InventoryAssetPriceAccountingRuleMovementGenerator(
"""
"""
"""
"""
def
_updateGeneratedMovementList
(
self
,
input_movement
,
generated_movement_list
):
"""Support Transit use case
"""
generated_movement_list
=
super
(
InventoryAssetPriceAccountingRuleMovementGenerator
,
self
,
).
_updateGeneratedMovementList
(
input_movement
,
generated_movement_list
,
)
for
movement
in
generated_movement_list
:
update_dict
=
{}
if
movement
.
getLedger
()
in
(
'stock/stock/entree'
,
'stock/transit/sortie'
,
'stock/customs/entree'
):
update_dict
[
'start_date'
]
=
update_dict
[
'stop_date'
]
=
input_movement
.
getStopDate
()
elif
movement
.
getLedger
()
in
(
'stock/preparation/sortie'
,
'stock/transit/entree'
):
update_dict
[
'start_date'
]
=
update_dict
[
'stop_date'
]
=
input_movement
.
getStartDate
()
movement
.
_edit
(
**
update_dict
)
input_movement
.
log
(
"%r (input_movement=%r): ledger=%r, start_date=%r, stop_date=%r"
%
(
movement
,
input_movement
,
movement
.
getLedger
(),
movement
.
getStartDate
(),
movement
.
getStopDate
()))
return
generated_movement_list
def
_getInputMovementList
(
self
,
movement_list
=
None
,
rounding
=
False
):
def
_getInputMovementList
(
self
,
movement_list
=
None
,
rounding
=
False
):
simulation_movement
=
self
.
_applied_rule
.
getParentValue
()
simulation_movement
=
self
.
_applied_rule
.
getParentValue
()
...
@@ -72,8 +42,6 @@ class InventoryAssetPriceAccountingRuleMovementGenerator(
...
@@ -72,8 +42,6 @@ class InventoryAssetPriceAccountingRuleMovementGenerator(
if
base_price
is
None
:
if
base_price
is
None
:
return
[]
return
[]
quantity
=
simulation_movement
.
getCorrectedQuantity
()
*
base_price
quantity
=
simulation_movement
.
getCorrectedQuantity
()
*
base_price
if
quantity
is
None
:
return
[]
return
[
simulation_movement
.
asContext
(
quantity
=
quantity
)]
return
[
simulation_movement
.
asContext
(
quantity
=
quantity
)]
...
@@ -82,10 +50,9 @@ class InventoryAssetPriceAccountingRuleMovementGenerator(
...
@@ -82,10 +50,9 @@ class InventoryAssetPriceAccountingRuleMovementGenerator(
self
,
self
,
input_movement
)
input_movement
)
if
input_movement
.
getRootAppliedRule
().
getCausalityValue
().
getPortalType
().
startswith
(
'Purchase'
):
order
=
input_movement
.
getRootAppliedRule
().
getCausalityValue
()
update_property_dict
[
'source_section'
]
=
input_movement
.
getDestinationSection
()
if
(
order
.
getPortalType
().
startswith
(
'Purchase'
)
or
not
input_movement
.
getSourceSection
()):
if
not
input_movement
.
getSourceSection
():
update_property_dict
[
'source_section'
]
=
input_movement
.
getDestinationSection
()
update_property_dict
[
'source_section'
]
=
input_movement
.
getDestinationSection
()
resource
=
input_movement
.
getSourceAssetPriceCurrency
()
resource
=
input_movement
.
getSourceAssetPriceCurrency
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment