[Erp5-report] r10651 - /erp5/trunk/products/ERP5/Document/
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Oct 11 11:40:10 CEST 2006
Author: alex
Date: Wed Oct 11 11:40:03 2006
New Revision: 10651
URL: http://svn.erp5.org?rev=10651&view=rev
Log:
Fix: d.update(a=1) does not work with python 2.3 ... simply create full dicts
instead of creating empty dicts and updating them.
Modified:
erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py
erp5/trunk/products/ERP5/Document/InvoicingRule.py
Modified: erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py?rev=10651&r1=10650&r2=10651&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py (original)
+++ erp5/trunk/products/ERP5/Document/InvoiceTransactionRule.py Wed Oct 11 11:40:03 2006
@@ -132,20 +132,20 @@
LOG("InvoiceTransactionRule", PROBLEM,
"expanding %s: without resource" % applied_rule.getPath())
- prevision_line = {}
- prevision_line.update(
- id = transaction_line.getId(),
- source = transaction_line.getSource(),
- destination = transaction_line.getDestination(),
- source_section = context_movement.getSourceSection(),
- destination_section = context_movement.getDestinationSection(),
- resource = resource,
+ prevision_line = {
+ 'id': transaction_line.getId(),
+ 'source': transaction_line.getSource(),
+ 'destination': transaction_line.getDestination(),
+ 'source_section': context_movement.getSourceSection(),
+ 'destination_section': context_movement.getDestinationSection(),
+ 'resource': resource,
# calculate (quantity * price) * cell_quantity
- quantity = (context_movement.getCorrectedQuantity() *
+ 'quantity': (context_movement.getCorrectedQuantity() *
context_movement.getPrice()) * transaction_line.getQuantity(),
- start_date = context_movement.getStartDate(),
- stop_date = context_movement.getStopDate(),
- force_update = 1)
+ 'start_date': context_movement.getStartDate(),
+ 'stop_date': context_movement.getStopDate(),
+ 'force_update': 1,
+ }
prevision_list.append(prevision_line)
return prevision_list
Modified: erp5/trunk/products/ERP5/Document/InvoicingRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/InvoicingRule.py?rev=10651&r1=10650&r2=10651&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/InvoicingRule.py (original)
+++ erp5/trunk/products/ERP5/Document/InvoicingRule.py Wed Oct 11 11:40:03 2006
@@ -108,23 +108,23 @@
or destination_section is None:
return []
- invoice_line = {}
- invoice_line.update(
- 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,
+ 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,
# We do need to collect invoice lines to build invoices
- deliverable=1
- )
+ 'deliverable': 1
+ }
return [invoice_line]
security.declareProtected(Permissions.ModifyPortalContent, 'expand')
More information about the Erp5-report
mailing list