diff --git a/__manifest__.py b/__manifest__.py index b0fec18..98913f9 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- { 'name': 'Vendor Batch Payment Merge', - 'version': '1.0', + 'version': '19.0.1.0.0', 'category': 'Accounting/Accounting', 'summary': 'Merge vendor payments and batch payments functionality', "author": "Suherdy Yacob", diff --git a/models/account_batch_payment.py b/models/account_batch_payment.py index 88992eb..a5d7e5b 100644 --- a/models/account_batch_payment.py +++ b/models/account_batch_payment.py @@ -84,7 +84,7 @@ class AccountBatchPayment(models.Model): 'date': line.date, 'journal_id': self.journal_id.id, 'payment_method_line_id': payment_method_line.id, - 'ref': line.memo, + 'memo': line.memo, 'expense_account_id': line.expense_account_id.id, } diff --git a/models/account_payment_register.py b/models/account_payment_register.py index 2fcf95c..4f06c9b 100644 --- a/models/account_payment_register.py +++ b/models/account_payment_register.py @@ -28,9 +28,8 @@ class AccountPaymentRegister(models.TransientModel): payment_vals = super()._create_payment_vals_from_wizard(batch_result) # If we have an expense account, replace the destination account - if self.expense_account_id and len(payment_vals.get('line_ids', [])) >= 2: - # The second line is typically the counterpart line (payable/receivable) - payment_vals['line_ids'][1]['account_id'] = self.expense_account_id.id + if self.expense_account_id: + payment_vals['destination_account_id'] = self.expense_account_id.id return payment_vals diff --git a/vendor_batch_payment_merge b/vendor_batch_payment_merge new file mode 160000 index 0000000..287d25f --- /dev/null +++ b/vendor_batch_payment_merge @@ -0,0 +1 @@ +Subproject commit 287d25f529feafa23919ab385498b698a941cf4b