Browse Source

[FIX] fix the user creation

pull/7/head
houssine 6 years ago
parent
commit
de7d155629
  1. 1
      easy_my_coop/__manifest__.py
  2. 11
      easy_my_coop/models/account_invoice.py

1
easy_my_coop/__manifest__.py

@ -16,7 +16,6 @@
"partner_contact_address", "partner_contact_address",
"website", "website",
"website_form_recaptcha", "website_form_recaptcha",
# "theme_light",
"email_template_config", "email_template_config",
], ],
"author": "Coop IT Easy SCRLfs", "author": "Coop IT Easy SCRLfs",

11
easy_my_coop/models/account_invoice.py

@ -35,8 +35,8 @@ class account_invoice(models.Model):
user.sudo().write({'active': True}) user.sudo().write({'active': True})
else: else:
user_values = {'partner_id': partner.id, 'login': email} 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() user.sudo().with_context({'create_user': True}).action_reset_password()
return True return True
@ -96,16 +96,17 @@ class account_invoice(models.Model):
return True return True
@api.multi @api.multi
def confirm_paid(self):
def action_invoice_paid(self):
super(account_invoice, self).action_invoice_paid()
for invoice in self: for invoice in self:
super(account_invoice, invoice).confirm_paid()
# we check if there is an open refund for this invoice. in this # we check if there is an open refund for this invoice. in this
# case we don't run the process_subscription function as the # case we don't run the process_subscription function as the
# invoice has been reconciled with a refund and not a payment. # invoice has been reconciled with a refund and not a payment.
refund = self.search([('type', '=', 'out_refund'), refund = self.search([('type', '=', 'out_refund'),
('origin', '=', invoice.move_name)]) ('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: and invoice.type == 'out_invoice' and not refund:
# take the effective date from the payment. # take the effective date from the payment.
# by default the confirmation date is the payment date # by default the confirmation date is the payment date

Loading…
Cancel
Save