Browse Source

Merge pull request #98 from coopiteasy/12.0-emc-ch

12.0 emc ch
pull/103/head
Houssine BAKKALI 5 years ago
committed by GitHub
parent
commit
38bc150944
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      easy_my_coop/models/partner.py
  2. 6
      easy_my_coop/views/account_invoice_view.xml
  3. 11
      easy_my_coop_website/controllers/main.py

17
easy_my_coop/models/partner.py

@ -211,9 +211,14 @@ class ResPartner(models.Model):
)
def get_cooperator_from_crn(self, company_register_number):
return self.env["res.partner"].search(
[
("cooperator", "=", True),
("company_register_number", "=", company_register_number),
]
)
company_register_number = company_register_number.strip()
if company_register_number:
partner = self.env["res.partner"].search(
[
("cooperator", "=", True),
("company_register_number", "=", company_register_number),
]
)
else:
partner = None
return partner

6
easy_my_coop/views/account_invoice_view.xml

@ -14,8 +14,7 @@
<field name="name">Cooperator Invoices</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity
</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field eval="False" name="view_id"/>
<field name="domain">[('type','in',('out_invoice',
'out_refund')),('release_capital_request','=',True)]
@ -53,8 +52,7 @@
<field name="name">Customer Invoices</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity
</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field eval="False" name="view_id"/>
<field name="domain">[('type','in',('out_invoice',
'out_refund')),('release_capital_request','=',False)]

11
easy_my_coop_website/controllers/main.py

@ -329,12 +329,13 @@ class WebsiteSubscription(http.Controller):
return request.render(redirect, values)
iban = kwargs.get("iban")
valid = sub_req_obj.check_iban(iban)
if iban.strip():
valid = sub_req_obj.check_iban(iban)
if not valid:
values = self.fill_values(values, is_company, logged)
values["error_msg"] = _("You iban account number" "is not valid")
return request.render(redirect, values)
if not valid:
values = self.fill_values(values, is_company, logged)
values["error_msg"] = _("You iban account number is not valid")
return request.render(redirect, values)
# check the subscription's amount
max_amount = company.subscription_maximum_amount

Loading…
Cancel
Save