[Erp5-report] r12049 - /erp5/trunk/products/ERP5/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 12 18:02:15 CET 2007


Author: romain
Date: Fri Jan 12 18:02:12 2007
New Revision: 12049

URL: http://svn.erp5.org?rev=12049&view=rev
Log:
Copy attributes and categories on SimulationMovement when expanding.

Modified:
    erp5/trunk/products/ERP5/Document/DeliveryRule.py
    erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py
    erp5/trunk/products/ERP5/Document/InvoicingRule.py
    erp5/trunk/products/ERP5/Document/OrderRule.py
    erp5/trunk/products/ERP5/Document/ProductionOrderRule.py

Modified: erp5/trunk/products/ERP5/Document/DeliveryRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/DeliveryRule.py?rev=12049&r1=12048&r2=12049&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/DeliveryRule.py (original)
+++ erp5/trunk/products/ERP5/Document/DeliveryRule.py Fri Jan 12 18:02:12 2007
@@ -115,6 +115,7 @@
             # Weare on a cell
             new_id = "%s_%s" % (deliv_mvt.getParentId(), deliv_mvt.getId())
           # Generate the simulation deliv_mvt
+          # XXX Hardcoded value
           new_sim_mvt = applied_rule.newContent(
               portal_type=movement_type,
               id=new_id,
@@ -123,33 +124,49 @@
               delivery_value=deliv_mvt,
               delivery_ratio=1,
               deliverable=1,
+
               source=deliv_mvt.getSource(),
               source_section=deliv_mvt.getSourceSection(),
               destination=deliv_mvt.getDestination(),
               destination_section=deliv_mvt.getDestinationSection(),
-              quantity=deliv_mvt.getQuantity(),
+              start_date=deliv_mvt.getStartDate(),
+              stop_date=deliv_mvt.getStopDate(),
+
               resource=deliv_mvt.getResource(),
               variation_category_list=deliv_mvt.getVariationCategoryList(),
               variation_property_dict=deliv_mvt.getVariationPropertyDict(),
-              start_date=deliv_mvt.getStartDate(),
-              stop_date=deliv_mvt.getStopDate())
+              aggregate_list=deliv_mvt.getAggregateList(),
+
+              quantity=deliv_mvt.getQuantity(),
+              quantity_unit=deliv_mvt.getQuantityUnit(),
+              price=deliv_mvt.getPrice(),
+              price_currency=deliv_mvt.getPriceCurrency(),
+          )
         elif sim_mvt in existing_movement_list:
           if sim_mvt not in immutable_movement_list:
             # modification allowed
+            # XXX Hardcoded value
             sim_mvt.edit(
                 delivery_value=deliv_mvt,
                 delivery_ratio=1,
                 deliverable=1,
+
                 source=deliv_mvt.getSource(),
                 source_section=deliv_mvt.getSourceSection(),
                 destination=deliv_mvt.getDestination(),
                 destination_section=deliv_mvt.getDestinationSection(),
-                quantity=deliv_mvt.getQuantity(),
+                start_date=deliv_mvt.getStartDate(),
+                stop_date=deliv_mvt.getStopDate(),
+
                 resource=deliv_mvt.getResource(),
                 variation_category_list=deliv_mvt.getVariationCategoryList(),
                 variation_property_dict=deliv_mvt.getVariationPropertyDict(),
-                start_date=deliv_mvt.getStartDate(),
-                stop_date=deliv_mvt.getStopDate(),
+                aggregate_list=deliv_mvt.getAggregateList(),
+
+                quantity=deliv_mvt.getQuantity(),
+                quantity_unit=deliv_mvt.getQuantityUnit(),
+                price=deliv_mvt.getPrice(),
+                price_currency=deliv_mvt.getPriceCurrency(),
                 force_update=1)
           else:
             # modification disallowed, must compensate

Modified: erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py?rev=12049&r1=12048&r2=12049&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py (original)
+++ erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py Fri Jan 12 18:02:12 2007
@@ -135,18 +135,27 @@
             LOG("InvoiceTransactionRule", PROBLEM,
                 "expanding %s: without resource" % applied_rule.getPath())
 
+        # XXX Harcoded list
         prevision_line = {
             'id': transaction_line.getId(),
             'source': transaction_line.getSource(),
+            'source_section': context_movement.getSourceSection(),
             'destination': transaction_line.getDestination(),
-            'source_section': context_movement.getSourceSection(),
             'destination_section': context_movement.getDestinationSection(),
+            'start_date': context_movement.getStartDate(),
+            'stop_date': context_movement.getStopDate(),
             'resource': resource,
+#               'variation_category_list': \
+#                   transaction_line.getVariationCategoryList(),
+#               'variation_property_dict': \
+#                   transaction_line.getVariationPropertyDict(),
+#               'aggregate_list': transaction_line.getAggregateList(),
+#               'price': transaction_line.getPrice(),
+#               'price_currency': transaction_line.getPriceCurrency(),
             # calculate (quantity * price) * cell_quantity
             'quantity': (context_movement.getCorrectedQuantity() *
               context_movement.getPrice()) * transaction_line.getQuantity(),
-            'start_date': context_movement.getStartDate(),
-            'stop_date': context_movement.getStopDate(),
+#               'quantity_unit': transaction_line.getQuantityUnit(),
             'force_update': 1,
             }
         prevision_list.append(prevision_line)

Modified: erp5/trunk/products/ERP5/Document/InvoicingRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/InvoicingRule.py?rev=12049&r1=12048&r2=12049&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/InvoicingRule.py (original)
+++ erp5/trunk/products/ERP5/Document/InvoicingRule.py Fri Jan 12 18:02:12 2007
@@ -108,21 +108,24 @@
     if source_section == destination_section or source_section is None \
         or destination_section is None:
       return []
-    
+
+    # XXX Harcoded list
     invoice_line = {
-        'price': context_movement.getPrice(),
-        'quantity': context_movement.getCorrectedQuantity(),
-        'quantity_unit': context_movement.getQuantityUnit(),
-        'efficiency': context_movement.getEfficiency(),
-        'resource': context_movement.getResource(),
-        'variation_category_list': context_movement.getVariationCategoryList(),
-        'variation_property_dict': context_movement.getVariationPropertyDict(),
-        'start_date': context_movement.getStartDate(),
-        'stop_date': context_movement.getStopDate(),
         'source': context_movement.getSource(),
         'source_section': source_section,
         'destination': context_movement.getDestination(),
         'destination_section': destination_section,
+        'start_date': context_movement.getStartDate(),
+        'stop_date': context_movement.getStopDate(),
+        'resource': context_movement.getResource(),
+        'variation_category_list': context_movement.getVariationCategoryList(),
+        'variation_property_dict': context_movement.getVariationPropertyDict(),
+        'aggregate_list': context_movement.getAggregateList(),
+        'quantity': context_movement.getCorrectedQuantity(),
+        'quantity_unit': context_movement.getQuantityUnit(),
+        'price': context_movement.getPrice(),
+        'price_currency': context_movement.getPriceCurrency(),
+        'efficiency': context_movement.getEfficiency(),
         # We do need to collect invoice lines to build invoices
         'deliverable': 1
         }

Modified: erp5/trunk/products/ERP5/Document/OrderRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/OrderRule.py?rev=12049&r1=12048&r2=12049&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/OrderRule.py (original)
+++ erp5/trunk/products/ERP5/Document/OrderRule.py Fri Jan 12 18:02:12 2007
@@ -163,12 +163,25 @@
     property_dict = {}
 
     if default_property_list is None:
-      LOG("Order Rule , _getPropertiesTo", WARNING,
-                                "Hardcoded properties set")
+      # XXX Hardcoded value
+#       LOG("Order Rule , _getPropertiesTo", WARNING,
+#                                 "Hardcoded properties set")
       default_property_list = (
-        'source_section', 'destination_section', 'source',
-        'destination', 'resource', 'variation_category_list',
-        'aggregate_list', 'start_date', 'stop_date')
+        'source',
+        'source_section', 
+        'destination', 
+        'destination_section', 
+        'start_date', 
+        'stop_date',
+        'resource', 
+        'variation_category_list',
+        'variation_property_dict', 
+        'aggregate_list', 
+        'price', 
+        'price_currency',
+        'quantity', 
+        'quantity_unit', 
+      )
   
       for prop in default_property_list:
          property_dict[prop] = movement.getProperty(prop)

Modified: erp5/trunk/products/ERP5/Document/ProductionOrderRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/ProductionOrderRule.py?rev=12049&r1=12048&r2=12049&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/ProductionOrderRule.py (original)
+++ erp5/trunk/products/ERP5/Document/ProductionOrderRule.py Fri Jan 12 18:02:12 2007
@@ -72,14 +72,23 @@
       property_dict = {}
 
       if default_property_list is None:
-        LOG("Order Rule , _getExpandablePropertyDict", WARNING,
-            "Hardcoded properties set")
+        # XXX Hardcoded value
+#         LOG("Order Rule , _getExpandablePropertyDict", WARNING,
+#             "Hardcoded properties set")
         default_property_list = (
+          'destination', 
           'destination_section',
-          'destination', 'resource', 
+          'start_date', 
+          'stop_date',
+          'resource', 
           'variation_category_list',
+          'variation_property_dict', 
           'aggregate_list',
-          'start_date', 'stop_date')
+          'price', 
+          'price_currency',
+          'quantity', 
+          'quantity_unit', 
+        )
     
       supply_chain = self.getSupplyChain(applied_rule)
       # We got a supply chain




More information about the Erp5-report mailing list