Skip to content
Snippets Groups Projects
Commit 81d3bb15 authored by Benjami's avatar Benjami
Browse files

Fix wizard creation :hatching_chick:

parent de27ed0b
No related branches found
No related tags found
2 merge requests!253[REL] Release 06/11/23,!191V1 imrpvements to CompanyEasyCreation wizard (CRM Lead execution)🙋‍
Pipeline #45825 passed
......@@ -301,10 +301,6 @@ class CrmLead(models.Model):
"vat": metadata.get("ce_vat", False) and metadata["ce_vat"] or None,
"foundation_date": foundation_date,
"default_lang_id": lang_id and lang_id.id or None,
"hierarchy_level": "community"
if self.source_id
== self.env.ref("energy_communities.ce_source_creation_ce_proposal")
else None,
"chart_template_id": self.env["account.chart.template"]
.search([("name", "=", "PGCE PYMEs 2008")])[0]
.id,
......@@ -346,18 +342,16 @@ class CrmLead(models.Model):
}
def action_create_community(self):
default_company_vals = {
"default_{}".format(field): value
for field, value in self._get_default_community_wizard().items()
}
data = self._get_default_community_wizard()
wizard = self.env["account.multicompany.easy.creation.wiz"].create(data)
return {
"type": "ir.actions.act_window",
"name": "Create community",
"res_model": "account.multicompany.easy.creation.wiz",
"view_type": "form",
"view_mode": "form",
"target": "new",
"context": default_company_vals,
"res_id": wizard.id,
}
......
......@@ -171,7 +171,7 @@ class AccountMulticompanyEasyCreationWiz(models.TransientModel):
self.new_company_id.write(vals)
def set_cooperative_account(self):
self_new_company = self.with_company(new_company_id)
self_new_company = self.with_company(self.new_company_id)
new_company = self_new_company.new_company_id
new_company.write(
{
......@@ -204,7 +204,7 @@ class AccountMulticompanyEasyCreationWiz(models.TransientModel):
self_new_company = self.with_company(self.new_company_id)
self_new_company.new_company_id.create_user = self.create_user
self.update_product_category_company_share()
# self.create_capital_share_product_template()
self.create_capital_share_product_template()
self.add_company_managers()
self.add_company_log()
return action
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment