Commit 3a4af252 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Accounting Rule Cell are created in the Invoice TransacrionRule Matrix with...

Accounting Rule Cell are created in the Invoice TransacrionRule Matrix with default Invoice Transaction Lines.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2009 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 55c44ed6
...@@ -105,11 +105,8 @@ class InvoiceTransactionRule(Rule, XMLMatrix): ...@@ -105,11 +105,8 @@ class InvoiceTransactionRule(Rule, XMLMatrix):
if force or \ if force or \
(applied_rule.getLastExpandSimulationState() not in applied_rule.getPortalReservedInventoryStateList() and \ (applied_rule.getLastExpandSimulationState() not in applied_rule.getPortalReservedInventoryStateList() and \
applied_rule.getLastExpandSimulationState() not in applied_rule.getPortalCurrentInventoryStateList()): applied_rule.getLastExpandSimulationState() not in applied_rule.getPortalCurrentInventoryStateList()):
# First, check each contained movement and make
# a list of invoice ids which do not need to be copied
# eventually delete movement which do not exist anylonger
existing_uid_list = []
# get the corresponding Cell
new_kw = (('product_line', my_product_line), ('region', my_destination_region)) new_kw = (('product_line', my_product_line), ('region', my_destination_region))
my_cell = my_invoice_transaction_rule.getCellByPredicate(*new_kw) #XXX WARNING ! : my_cell can be None my_cell = my_invoice_transaction_rule.getCellByPredicate(*new_kw) #XXX WARNING ! : my_cell can be None
...@@ -118,6 +115,11 @@ class InvoiceTransactionRule(Rule, XMLMatrix): ...@@ -118,6 +115,11 @@ class InvoiceTransactionRule(Rule, XMLMatrix):
else : else :
my_cell_transaction_id_list = [] my_cell_transaction_id_list = []
# check each contained movement and make
# a list of invoice ids which do not need to be copied
# eventually delete movement which do not exist anylonger
existing_uid_list = []
for movement in applied_rule.contentValues(): for movement in applied_rule.contentValues():
if movement.getId() in my_cell_transaction_id_list : if movement.getId() in my_cell_transaction_id_list :
existing_uid_list += [movement.getUid()] existing_uid_list += [movement.getUid()]
...@@ -201,7 +203,9 @@ class InvoiceTransactionRule(Rule, XMLMatrix): ...@@ -201,7 +203,9 @@ class InvoiceTransactionRule(Rule, XMLMatrix):
This method can be overriden This method can be overriden
""" """
self.invokeFactory(type_name='Accounting Rule Cell',id=id) self.invokeFactory(type_name='Accounting Rule Cell',id=id)
return self.get(id) new_cell = self.get(id)
new_cell.SaleInvoiceTransaction_init() # This is a site dependant script, it is used to create default invoice transaction lines.
return new_cell
security.declareProtected(Permissions.ModifyPortalContent, 'updateMatrix') security.declareProtected(Permissions.ModifyPortalContent, 'updateMatrix')
def updateMatrix(self) : def updateMatrix(self) :
......
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