Commit f9dffaf0 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

erp5_base: BuilderMixin, update call to newTempMovement

parent d44d3df3
......@@ -174,7 +174,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
def generateMovementListForStockOptimisation(self, group_by_node=1,
allow_intermediate_negative_stock=True,
**kw):
from Products.ERP5Type.Document import newTempMovement
now = DateTime()
movement_list = []
for attribute, method in [('node_uid', 'getDestinationUid'),
......@@ -298,7 +297,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
from_date=None,
group_by_node=1, allow_intermediate_negative_stock=True,
**kw):
from Products.ERP5Type.Document import newTempMovement
portal = self.getPortalObject()
if not from_date:
from_date = DateTime().earliestTime()
......@@ -392,7 +390,11 @@ class BuilderMixin(XMLObject, Amount, Predicate):
def newMovement(effective_date, start_date, stop_date, quantity, quantity_unit):
# Create temporary movement
# Do not handle variation and Item for now
movement = newTempMovement(portal, "temp")
movement = self.getPortalObject().newContent(
temp_object=True,
portal_type="Movement",
id="temp",
)
movement.edit(
resource_value=resource_value,
destination_value=supply.getDestinationValue(),
......
......@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>BuilderMixin</string> </value>
......@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.mixin.builder</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>mixin.erp5.BuilderMixin</string> </value>
......@@ -37,7 +49,15 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
<tuple>
<string>W:496, 0: Bad indentation. Found 9 spaces, expected 8 (bad-indentation)</string>
<string>W:447, 14: Unused variable \'inventory\' (unused-variable)</string>
<string>W:447, 35: Unused variable \'portal_type\' (unused-variable)</string>
<string>W:328, 4: Unused variable \'max_order_in_default_quantity_unit\' (unused-variable)</string>
<string>W:447, 8: Unused variable \'date\' (unused-variable)</string>
<string>W:327, 4: Unused variable \'min_order_in_default_quantity_unit\' (unused-variable)</string>
<string>W:506, 18: Unused variable \'total_inventory\' (unused-variable)</string>
</tuple>
</value>
</item>
<item>
......@@ -47,13 +67,28 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -66,7 +101,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -75,7 +110,7 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment