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. 7
      easy_my_coop/models/partner.py
  2. 6
      easy_my_coop/views/account_invoice_view.xml
  3. 3
      easy_my_coop_website/controllers/main.py

7
easy_my_coop/models/partner.py

@ -211,9 +211,14 @@ class ResPartner(models.Model):
) )
def get_cooperator_from_crn(self, company_register_number): def get_cooperator_from_crn(self, company_register_number):
return self.env["res.partner"].search(
company_register_number = company_register_number.strip()
if company_register_number:
partner = self.env["res.partner"].search(
[ [
("cooperator", "=", True), ("cooperator", "=", True),
("company_register_number", "=", company_register_number), ("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="name">Cooperator Invoices</field>
<field name="res_model">account.invoice</field> <field name="res_model">account.invoice</field>
<field name="view_type">form</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 eval="False" name="view_id"/>
<field name="domain">[('type','in',('out_invoice', <field name="domain">[('type','in',('out_invoice',
'out_refund')),('release_capital_request','=',True)] 'out_refund')),('release_capital_request','=',True)]
@ -53,8 +52,7 @@
<field name="name">Customer Invoices</field> <field name="name">Customer Invoices</field>
<field name="res_model">account.invoice</field> <field name="res_model">account.invoice</field>
<field name="view_type">form</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 eval="False" name="view_id"/>
<field name="domain">[('type','in',('out_invoice', <field name="domain">[('type','in',('out_invoice',
'out_refund')),('release_capital_request','=',False)] 'out_refund')),('release_capital_request','=',False)]

3
easy_my_coop_website/controllers/main.py

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

Loading…
Cancel
Save