Browse Source

Merge branch '12.0-emc-security' into 12.0

pull/51/head
robin.keunen 5 years ago
parent
commit
d373d886ed
  1. 2
      easy_my_coop/demo/coop.xml
  2. 2
      easy_my_coop/views/menus.xml
  3. 6
      easy_my_coop/views/res_partner_view.xml
  4. 1
      easy_my_coop_loan/demo/coop.xml
  5. 6
      easy_my_coop_loan/models/partner.py
  6. 2
      easy_my_coop_loan/tests/test_emc_loan.py

2
easy_my_coop/demo/coop.xml

@ -77,7 +77,7 @@
</record>
<record id="base.main_company" model="res.company">
<field name="property_cooperator_account" ref="account_cooperator_demo"/>
<field name="property_cooperator_account" ref="easy_my_coop.account_cooperator_demo"/>
</record>
<record id="product_template_share_type_1_demo" model="product.template">

2
easy_my_coop/views/menus.xml

@ -12,7 +12,7 @@
<menuitem name="Cooperator Candidates" id="menu_easy_my_coop_cooperator_candidate" action="action_partner_cooperator_candidate_form" parent="menu_easy_my_coop_main_subscription" sequence="140" />
<menuitem name="Subscription Register" id="menu_easy_my_coop_subscription_register" action="subscription_register_action" parent="menu_easy_my_coop_main_subscription" sequence="150" />
<menuitem name="Operation request" id="menu_easy_my_coop_operation_request" action="operation_request_action" parent="menu_easy_my_coop_main_subscription" groups="easy_my_coop.group_easy_my_coop_user" sequence="160" />
<menuitem name="Share Lines" id="menu_easy_my_coop_share_line" action="share_line_action" parent="menu_easy_my_coop_main_subscription" groups="base.group_system" sequence="170" />
<!-- <menuitem name="Share Lines" id="menu_easy_my_coop_share_line" action="share_line_action" parent="menu_easy_my_coop_main_subscription" groups="base.group_erp_manager" sequence="170" />-->
<menuitem name="Contacts" id="menu_easy_my_coop_main_coop" parent="menu_main_easy_my_coop" sequence="20"/>
<menuitem name="Cooperators" id="menu_easy_my_coop_cooperator" action="action_partner_cooperator_form" parent="menu_easy_my_coop_main_coop" sequence="210" />

6
easy_my_coop/views/res_partner_view.xml

@ -87,13 +87,13 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='supplier']" position='after'>
<filter name="supplier" position='after'>
<filter string="Cooperators" name="cooperators" domain="[('member','=',1)]" help="Cooperator Partners"/>
<filter string="Old Cooperators" name="old_cooperators" domain="[('old_member','=',1)]" help="Cooperator Partners"/>
<filter string="Cooperator Candidates" name="cooperator_candidates" domain="[('coop_candidate','=',1)]" help="Cooperator Partners"/>
</xpath>
</filter>
<filter name="salesperson" position="before">
<filter name="Cooperator Type" context="{'group_by': 'cooperator_type'}"/>
<filter string="Cooperator Type" name="group_by_cooperator_type" context="{'group_by': 'cooperator_type'}"/>
</filter>
</field>
</record>

1
easy_my_coop_loan/demo/coop.xml

@ -6,7 +6,6 @@
<odoo>
<record id="loan_issue_1_demo" model="loan.issue">
<field name="name">test loan issue</field>
<field name="is_bond" eval="False"/>
<field name="default_issue" eval="True"/>
<field name="subscription_start_date" eval="datetime.today()"/>
<field name="subscription_end_date" eval="datetime.today() + timedelta(days=60)"/>

6
easy_my_coop_loan/models/partner.py

@ -1,5 +1,6 @@
# Copyright 2019 Coop IT Easy SCRL fs
# Houssine BAKKALI <houssine@coopiteasy.be>
# Robin Keunen <robin@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models, api
@ -23,7 +24,8 @@ class ResPartner(models.Model):
@api.depends("loan_line_ids", "loan_line_ids.state")
def _compute_is_loaner(self):
for partner in self:
loans = partner.loan_line_ids.filtered(
sudo_partner = partner.sudo()
loans = sudo_partner.loan_line_ids.filtered(
lambda l: l.state in ["subscribed", "waiting", "paid"]
)
partner.is_loaner = bool(loans)
sudo_partner.is_loaner = bool(loans)

2
easy_my_coop_loan/tests/test_emc_loan.py

@ -13,7 +13,6 @@ class EMCLoanCase(EMCBaseCase):
loan_issue_values = {
"name": "test loan issue",
"is_bond": False,
"default_issue": "xx",
"subscription_start_date": Date.today(),
"subscription_end_date": Date.today() + timedelta(days=60),
@ -43,7 +42,6 @@ class EMCLoanCase(EMCBaseCase):
loan_issue_values = {
"name": "test loan issue",
"is_bond": False,
"default_issue": True,
"user_id": self.ref("easy_my_coop.res_users_manager_emc_demo"),
"subscription_start_date": Date.today(),

Loading…
Cancel
Save