Browse Source

make travis green again

pull/123/head
robin.keunen 4 years ago
parent
commit
ec04c0f2f7
  1. 4
      easy_my_coop/models/company.py
  2. 9
      easy_my_coop/models/coop.py
  3. 2
      easy_my_coop/models/operation_request.py
  4. 9
      easy_my_coop/models/partner.py
  5. 6
      easy_my_coop/views/email_template_view.xml
  6. 6
      easy_my_coop/views/res_partner_view.xml
  7. 2
      easy_my_coop_website_taxshelter/controllers/main.py

4
easy_my_coop/models/company.py

@ -90,7 +90,7 @@ class ResCompany(models.Model):
) )
financial_risk_approval_text = fields.Html( financial_risk_approval_text = fields.Html(
translate=True, translate=True,
help="Text to display aside the checkbox to approve financial risk."
help="Text to display aside the checkbox to approve financial risk.",
) )
@api.onchange("data_policy_approval_required") @api.onchange("data_policy_approval_required")
@ -103,7 +103,7 @@ class ResCompany(models.Model):
if self.internal_rules_approval_required: if self.internal_rules_approval_required:
self.display_internal_rules_approval = True self.display_internal_rules_approval = True
@api.onchange('financial_risk_approval_required')
@api.onchange("financial_risk_approval_required")
def onchange_financial_risk_approval_required(self): def onchange_financial_risk_approval_required(self):
if self.financial_risk_approval_required: if self.financial_risk_approval_required:
self.display_financial_risk_approval = True self.display_financial_risk_approval = True

9
easy_my_coop/models/coop.py

@ -44,7 +44,7 @@ class SubscriptionRequest(models.Model):
if company.internal_rules_approval_required: if company.internal_rules_approval_required:
required_fields.append("internal_rules_approved") required_fields.append("internal_rules_approved")
if company.financial_risk_approval_required: if company.financial_risk_approval_required:
required_fields.append('financial_risk_approved')
required_fields.append("financial_risk_approved")
return required_fields return required_fields
def get_mail_template_notif(self, is_company=False): def get_mail_template_notif(self, is_company=False):
@ -432,8 +432,7 @@ class SubscriptionRequest(models.Model):
string="Approved Internal Rules", default=False string="Approved Internal Rules", default=False
) )
financial_risk_approved = fields.Boolean( financial_risk_approved = fields.Boolean(
string='Financial Risk Approved',
default=False,
string="Financial Risk Approved", default=False
) )
_order = "id desc" _order = "id desc"
@ -580,7 +579,7 @@ class SubscriptionRequest(models.Model):
"lang": self.lang, "lang": self.lang,
"data_policy_approved": self.data_policy_approved, "data_policy_approved": self.data_policy_approved,
"internal_rules_approved": self.internal_rules_approved, "internal_rules_approved": self.internal_rules_approved,
'financial_risk_approved': self.financial_risk_approved
"financial_risk_approved": self.financial_risk_approved,
} }
return partner_vals return partner_vals
@ -602,7 +601,7 @@ class SubscriptionRequest(models.Model):
"customer": self.share_product_id.customer, "customer": self.share_product_id.customer,
"data_policy_approved": self.data_policy_approved, "data_policy_approved": self.data_policy_approved,
"internal_rules_approved": self.internal_rules_approved, "internal_rules_approved": self.internal_rules_approved,
"financial_risk_approved": self.financial_risk_approved
"financial_risk_approved": self.financial_risk_approved,
} }
return partner_vals return partner_vals

2
easy_my_coop/models/operation_request.py

@ -29,7 +29,7 @@ class OperationRequest(models.Model):
request_date = fields.Date( request_date = fields.Date(
string="Request date", default=lambda self: self.get_date_now() string="Request date", default=lambda self: self.get_date_now()
) )
effective_date = fields.Date(string='Effective date')
effective_date = fields.Date(string="Effective date")
partner_id = fields.Many2one( partner_id = fields.Many2one(
"res.partner", "res.partner",
string="Cooperator", string="Cooperator",

9
easy_my_coop/models/partner.py

@ -206,12 +206,11 @@ class ResPartner(models.Model):
member_companies = self.env["res.partner"].search( member_companies = self.env["res.partner"].search(
[("is_company", "=", True), ("member", "=", True)] [("is_company", "=", True), ("member", "=", True)]
) )
representatives = member_companies.mapped("child_ids").filtered(
"representative"
)
partner.representative_of_member_company = ( partner.representative_of_member_company = (
partner in member_companies.mapped(
"child_ids"
).filtered(
"representative"
)
partner in representatives
) )
@api.multi @api.multi

6
easy_my_coop/views/email_template_view.xml

@ -16,9 +16,9 @@
<field name="model">mail.template</field> <field name="model">mail.template</field>
<field name="inherit_id" ref="mail.email_template_form"/> <field name="inherit_id" ref="mail.email_template_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="mail_server_id" position="after">
<field name="easy_my_coop"/>
</field>
<field name="mail_server_id" position="after">
<field name="easy_my_coop"/>
</field>
</field> </field>
</record> </record>
</odoo> </odoo>

6
easy_my_coop/views/res_partner_view.xml

@ -54,11 +54,11 @@
</group> </group>
<group name="approvals"> <group name="approvals">
<field name="internal_rules_approved" <field name="internal_rules_approved"
attrs="{'invisible':[('member','=',False)]}"/>
attrs="{'invisible':[('member','=',False)]}"/>
<field name="data_policy_approved" <field name="data_policy_approved"
attrs="{'invisible':[('member','=',False)]}"/>
attrs="{'invisible':[('member','=',False)]}"/>
<field name="financial_risk_approved" <field name="financial_risk_approved"
attrs="{'invisible':[('member','=',False)]}"/>
attrs="{'invisible':[('member','=',False)]}"/>
</group> </group>
</group> </group>
</xpath> </xpath>

2
easy_my_coop_website_taxshelter/controllers/main.py

@ -118,7 +118,7 @@ class PortalTaxShelter(CustomerPortal):
report_type=None, report_type=None,
download=False, download=False,
query_string=None, query_string=None,
**kw
**kw,
): ):
partner = request.env.user.partner_id partner = request.env.user.partner_id
try: try:

Loading…
Cancel
Save