diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml index 3fb5107aef9e9f3c70a63740135239ee214e77fb..bf6afeff156e5d8353e2b922a7ad4632508fc06f 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml @@ -110,16 +110,17 @@ if context.getStopDate() != context.getStartDate():\n if context.getProperty(\'payment_mode\'):\n reversal.setProperty(\'payment_mode\', context.getProperty(\'payment_mode\'))\n \n -line_list = context.getMovementList(\n +line_list = context.AccountingTransaction_getInvoiceTransactionLineList(\n portal_type=context.getPortalAccountingMovementTypeList())\n +line_list.reverse()\n +\n # guess portal_type to create lines\n if line_list:\n line_portal_type = line_list[0].getPortalType()\n \n for line in line_list:\n - new_line = reversal.newContent( portal_type=\'Accounting Transaction Line\', )\n + new_line = reversal.newContent( portal_type=line_portal_type )\n new_line.edit(\n - id=line.getId(),\n source=line.getSource(portal_type=\'Account\'),\n destination=line.getDestination(portal_type=\'Account\'),\n quantity= - line.getQuantity(),\n @@ -129,7 +130,7 @@ for line in line_list:\n \n # copy some values if they are defined explicitly on line\n for prop in [ \'source_section\', \'destination_section\',\n - \'source_payment\', \'destination_payment\', ]:\n + \'source_payment\', \'destination_payment\', \'resource\' ]:\n if line.getProperty(prop) != context.getProperty(prop):\n new_line.setProperty(prop, line.getProperty(prop))\n \n diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 946b551d71c2c264c949222738cfc5f55c684175..681cf043cbf0cf47969386e083423ae7432949c9 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -191 \ No newline at end of file +192 \ No newline at end of file