diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py index af4b3a1a2..7c39a46ca 100644 --- a/base_accounting_kit/__manifest__.py +++ b/base_accounting_kit/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Odoo 13 Full Accounting Kit', - 'version': '13.0.1.2.1', + 'version': '13.0.1.3.1', 'category': 'Accounting', 'summary': """ This Module will bring back the accounting features such Asset Management, Budget Management, Accounting Reports, diff --git a/base_accounting_kit/doc/RELEASE_NOTES.md b/base_accounting_kit/doc/RELEASE_NOTES.md index c8a5901f0..6cfb28361 100644 --- a/base_accounting_kit/doc/RELEASE_NOTES.md +++ b/base_accounting_kit/doc/RELEASE_NOTES.md @@ -14,3 +14,8 @@ #### Version 13.0.1.2.1 #### ADD - Added Budget Management. + +#### 31.10.2019 +#### Version 13.0.1.3.1 +#### FIX +- Bug Fixed 'Recurring paymenst' diff --git a/base_accounting_kit/wizard/recurring_payments.py b/base_accounting_kit/wizard/recurring_payments.py index 09d01b96c..c81976162 100644 --- a/base_accounting_kit/wizard/recurring_payments.py +++ b/base_accounting_kit/wizard/recurring_payments.py @@ -35,6 +35,12 @@ class RecurringPaymentsWizard(models.TransientModel): recurring_tmpl_ids = fields.Many2many('account.recurring.payments', string='Recurring Template') + @api.model + def default_get(self, fields): + result = super(RecurringPaymentsWizard, self).default_get(fields) + self.get_remaining_entries() + return result + @api.onchange('date_from', 'recurring_tmpl_ids') def get_remaining_entries(self): if self.date_from: @@ -95,33 +101,31 @@ class RecurringPaymentsWizard(models.TransientModel): if not data: raise UserError(_("There is no remaining payments")) for line in data: - this = line.tmpl_id - recurr_code = str(this.id) + '/' + str(line.date) + tmpl_id = line.tmpl_id + recurr_code = str(tmpl_id.id) + '/' + str(line.date) line_ids = [(0, 0, { - 'account_id': this.credit_account.id, - 'partner_id': this.partner_id.id, + 'account_id': tmpl_id.credit_account.id, + 'partner_id': tmpl_id.partner_id.id, 'credit': line.amount, - 'analytic_account_id': this.analytic_account_id.id, - 'narration': 'Recurring entry of "%s"' % this.name, + 'analytic_account_id': tmpl_id.analytic_account_id.id, }), (0, 0, { - 'account_id': this.debit_account.id, - 'partner_id': this.partner_id.id, + 'account_id': tmpl_id.debit_account.id, + 'partner_id': tmpl_id.partner_id.id, 'debit': line.amount, - 'analytic_account_id': this.analytic_account_id.id, - 'narration': 'Recurring entry of "%s"' % this.name, + 'analytic_account_id': tmpl_id.analytic_account_id.id, })] vals = { 'date': line.date, 'recurring_ref': recurr_code, 'company_id': self.env.user.company_id.id, - 'journal_id': this.journal_id.id, - 'is_active': True, + 'journal_id': tmpl_id.journal_id.id, 'ref': line.template_name, + 'narration': 'Recurring entry', 'line_ids': line_ids } move_id = self.env['account.move'].create(vals) - if this.journal_state == 'posted': + if tmpl_id.journal_state == 'posted': move_id.post() @@ -132,4 +136,4 @@ class GetAllRecurringEntries(models.TransientModel): template_name = fields.Char('Name') amount = fields.Float('Amount') tmpl_id = fields.Many2one('account.recurring.payments', string='id') - p_id = fields.Many2one('recurring.payments.wizard') + p_id = fields.Many2one('recurring.payments.wizard') \ No newline at end of file diff --git a/base_accounting_kit/wizard/recurring_payments_wizard.xml b/base_accounting_kit/wizard/recurring_payments_wizard.xml index da49c4969..7ca46ee91 100644 --- a/base_accounting_kit/wizard/recurring_payments_wizard.xml +++ b/base_accounting_kit/wizard/recurring_payments_wizard.xml @@ -8,6 +8,9 @@ recurring.payments.wizard
+
+ Only recurring templates which are in the running stage will be considered. +