Commit 2e8f438d authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_base: BuilderMixin, update call to newTempMovement

parent 631e3e54
...@@ -174,7 +174,6 @@ class BuilderMixin(XMLObject, Amount, Predicate): ...@@ -174,7 +174,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
def generateMovementListForStockOptimisation(self, group_by_node=1, def generateMovementListForStockOptimisation(self, group_by_node=1,
allow_intermediate_negative_stock=True, allow_intermediate_negative_stock=True,
**kw): **kw):
from Products.ERP5Type.Document import newTempMovement
now = DateTime() now = DateTime()
movement_list = [] movement_list = []
for attribute, method in [('node_uid', 'getDestinationUid'), for attribute, method in [('node_uid', 'getDestinationUid'),
...@@ -298,7 +297,6 @@ class BuilderMixin(XMLObject, Amount, Predicate): ...@@ -298,7 +297,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
from_date=None, from_date=None,
group_by_node=1, allow_intermediate_negative_stock=True, group_by_node=1, allow_intermediate_negative_stock=True,
**kw): **kw):
from Products.ERP5Type.Document import newTempMovement
portal = self.getPortalObject() portal = self.getPortalObject()
if not from_date: if not from_date:
from_date = DateTime().earliestTime() from_date = DateTime().earliestTime()
...@@ -392,7 +390,11 @@ class BuilderMixin(XMLObject, Amount, Predicate): ...@@ -392,7 +390,11 @@ class BuilderMixin(XMLObject, Amount, Predicate):
def newMovement(effective_date, start_date, stop_date, quantity, quantity_unit): def newMovement(effective_date, start_date, stop_date, quantity, quantity_unit):
# Create temporary movement # Create temporary movement
# Do not handle variation and Item for now # 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( movement.edit(
resource_value=resource_value, resource_value=resource_value,
destination_value=supply.getDestinationValue(), destination_value=supply.getDestinationValue(),
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>BuilderMixin</string> </value> <value> <string>BuilderMixin</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.mixin.builder</string> </value> <value> <string>Products.ERP5.mixin.builder</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>mixin.erp5.BuilderMixin</string> </value> <value> <string>mixin.erp5.BuilderMixin</string> </value>
...@@ -37,7 +49,15 @@ ...@@ -37,7 +49,15 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <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> </value>
</item> </item>
<item> <item>
...@@ -47,13 +67,28 @@ ...@@ -47,13 +67,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <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> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -66,7 +101,7 @@ ...@@ -66,7 +101,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -75,7 +110,7 @@ ...@@ -75,7 +110,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </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