From de7d155629caaeade827b5ca453fccd6abf6c1ea Mon Sep 17 00:00:00 2001 From: houssine Date: Fri, 10 May 2019 16:36:35 +0200 Subject: [PATCH] [FIX] fix the user creation --- easy_my_coop/__manifest__.py | 1 - easy_my_coop/models/account_invoice.py | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/easy_my_coop/__manifest__.py b/easy_my_coop/__manifest__.py index c53e759..165746d 100644 --- a/easy_my_coop/__manifest__.py +++ b/easy_my_coop/__manifest__.py @@ -16,7 +16,6 @@ "partner_contact_address", "website", "website_form_recaptcha", - # "theme_light", "email_template_config", ], "author": "Coop IT Easy SCRLfs", diff --git a/easy_my_coop/models/account_invoice.py b/easy_my_coop/models/account_invoice.py index 3b3c05e..981e37b 100644 --- a/easy_my_coop/models/account_invoice.py +++ b/easy_my_coop/models/account_invoice.py @@ -35,8 +35,8 @@ class account_invoice(models.Model): user.sudo().write({'active': True}) else: user_values = {'partner_id': partner.id, 'login': email} - user_id = user_obj.sudo()._signup_create_user(user_values) - user = user_obj.browse(user_id) + user = user_obj.sudo()._signup_create_user(user_values) + # user = user_obj.browse(user_id) user.sudo().with_context({'create_user': True}).action_reset_password() return True @@ -96,16 +96,17 @@ class account_invoice(models.Model): return True @api.multi - def confirm_paid(self): + def action_invoice_paid(self): + super(account_invoice, self).action_invoice_paid() for invoice in self: - super(account_invoice, invoice).confirm_paid() # we check if there is an open refund for this invoice. in this # case we don't run the process_subscription function as the # invoice has been reconciled with a refund and not a payment. refund = self.search([('type', '=', 'out_refund'), ('origin', '=', invoice.move_name)]) - if invoice.partner_id.cooperator and invoice.release_capital_request \ + if invoice.partner_id.cooperator \ + and invoice.release_capital_request \ and invoice.type == 'out_invoice' and not refund: # take the effective date from the payment. # by default the confirmation date is the payment date