houssine 5 years ago
parent
commit
183b0b8395
  1. 2
      easy_my_coop/demo/coop.xml
  2. 22
      easy_my_coop/views/res_partner_view.xml
  3. 1
      easy_my_coop_document/__openerp__.py
  4. 31
      easy_my_coop_loan/models/partner.py
  5. 2
      easy_my_coop_loan/views/loan_view.xml
  6. 4
      easy_my_coop_loan/views/menus.xml
  7. 31
      easy_my_coop_loan/views/partner_view.xml
  8. 1
      easy_my_coop_taxshelter_report/__openerp__.py

2
easy_my_coop/demo/coop.xml

@ -14,6 +14,7 @@
<field name="city">Namur (Loyers)</field> <field name="city">Namur (Loyers)</field>
<field name="zip">5101</field> <field name="zip">5101</field>
<field name="country_id" ref="base.be"/> <field name="country_id" ref="base.be"/>
<field name="member" eval="True"/>
</record> </record>
<record id="bank_account_virginie_demo" model="res.partner.bank"> <record id="bank_account_virginie_demo" model="res.partner.bank">
@ -31,6 +32,7 @@
<field name="city">Namur (Loyers)</field> <field name="city">Namur (Loyers)</field>
<field name="zip">5101</field> <field name="zip">5101</field>
<field name="country_id" ref="base.be"/> <field name="country_id" ref="base.be"/>
<field name="member" eval="True"/>
</record> </record>
<record id="bank_account_houssine_demo" model="res.partner.bank"> <record id="bank_account_houssine_demo" model="res.partner.bank">

22
easy_my_coop/views/res_partner_view.xml

@ -1,4 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Coop IT Easy
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo> <odoo>
<data> <data>
<record id="view_partner_form_easy_my_coop" model="ir.ui.view"> <record id="view_partner_form_easy_my_coop" model="ir.ui.view">
@ -84,7 +88,9 @@
<field name="inherit_id" ref="base.view_res_partner_filter"/> <field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//filter[@name='supplier']" position='after'> <xpath expr="//filter[@name='supplier']" position='after'>
<filter string="Cooperators" name="cooperator" domain="[('member','=',1)]" help="Cooperator Partners"/>
<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> </xpath>
<filter name="salesperson" position="before"> <filter name="salesperson" position="before">
<filter name="Cooperator Type" context="{'group_by': 'cooperator_type'}"/> <filter name="Cooperator Type" context="{'group_by': 'cooperator_type'}"/>
@ -93,14 +99,12 @@
</record> </record>
<record id="action_partner_cooperator_form" model="ir.actions.act_window"> <record id="action_partner_cooperator_form" model="ir.actions.act_window">
<field name="name">Cooperator</field>
<field name="type">ir.actions.act_window</field>
<field name="name">Cooperators</field>
<field name="res_model">res.partner</field> <field name="res_model">res.partner</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field> <field name="view_mode">kanban,tree,form</field>
<field name="domain">[('cooperator','=',True),('member','=',True),('old_member','=',False)]</field>
<field name="context">{'default_cooperator':1, 'search_default_cooperator':1}</field>
<field name="filter" eval="True"/>
<field name="domain">['|', ('cooperator','=',True), '|', ('member','=',True),('old_member','=', True)]</field>
<field name="context">{'default_cooperator':1, 'search_default_cooperators':1}</field>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">
Click to add a contact in your address book. Click to add a contact in your address book.
@ -118,8 +122,8 @@
<field name="res_model">res.partner</field> <field name="res_model">res.partner</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field> <field name="view_mode">kanban,tree,form</field>
<field name="domain">[('cooperator','=',True),('coop_candidate','=',True),('member','=',False)]</field>
<field name="context">{'default_cooperator':1}</field>
<field name="domain">[('cooperator','=',True)]</field>
<field name="context">{'default_cooperator':1, 'search_default_cooperator_candidates':1}</field>
<field name="filter" eval="True"/> <field name="filter" eval="True"/>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">

1
easy_my_coop_document/__openerp__.py

@ -4,6 +4,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
# migrate in v12 and isolate from emc
'name': 'Easy My Coop Document', 'name': 'Easy My Coop Document',
'summary': """ 'summary': """

31
easy_my_coop_loan/models/partner.py

@ -1,9 +1,30 @@
from odoo import fields, models
# -*- coding: utf-8 -*-
# Copyright 2019 Coop IT Easy SCRL fs
# Robin Keunen <robin@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models, api
class ResPartner(models.Model): class ResPartner(models.Model):
_inherit = 'res.partner'
_inherit = "res.partner"
loan_line_ids = fields.One2many(
comodel_name="loan.issue.line",
inverse_name="partner_id",
string="Loans",
)
is_loaner = fields.Boolean(
string="Loaner",
compute="_compute_is_loaner",
store=True,
)
loan_line_ids = fields.One2many('loan.issue.line',
'partner_id',
string="Loans")
@api.multi
@api.depends("loan_line_ids", "loan_line_ids.state")
def _compute_is_loaner(self):
for partner in self:
loans = partner.loan_line_ids.filtered(
lambda l: l.state in ["subscribed", "waiting", "paid"]
)
partner.is_loaner = bool(loans)

2
easy_my_coop_loan/views/loan_view.xml

@ -104,7 +104,7 @@
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<record id="action_follow_individual_loan" model="ir.actions.act_window">
<record id="action_loan_issue_lines" model="ir.actions.act_window">
<field name="name">Loans</field> <field name="name">Loans</field>
<field name="res_model">loan.issue.line</field> <field name="res_model">loan.issue.line</field>
<field name="view_type">form</field> <field name="view_type">form</field>

4
easy_my_coop_loan/views/menus.xml

@ -6,7 +6,9 @@
<odoo> <odoo>
<menuitem name="Loan Management" id="menu_easy_my_coop_main_loan_issue" parent="easy_my_coop.menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_user" sequence="15"/> <menuitem name="Loan Management" id="menu_easy_my_coop_main_loan_issue" parent="easy_my_coop.menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_user" sequence="15"/>
<menuitem name="Loan Issues" id="loan_issue_menu" action="action_loan_issue" parent="menu_easy_my_coop_main_loan_issue" sequence="110"/> <menuitem name="Loan Issues" id="loan_issue_menu" action="action_loan_issue" parent="menu_easy_my_coop_main_loan_issue" sequence="110"/>
<menuitem name="Loans" id="individual_loan_menu" action="action_follow_individual_loan" parent="menu_easy_my_coop_main_loan_issue" sequence="120"/>
<menuitem name="Loans" id="loan_issue_line_menu" action="action_loan_issue_lines" parent="menu_easy_my_coop_main_loan_issue" sequence="120"/>
<menuitem name="Loaners" id="loaners_menu" action="action_loaners" parent="easy_my_coop.menu_easy_my_coop_main_coop" sequence="215" />
<menuitem name="Loan Term" id="loan_term_menu" action="action_loan_term" parent="easy_my_coop.menu_easy_my_coop_config" sequence="420"/> <menuitem name="Loan Term" id="loan_term_menu" action="action_loan_term" parent="easy_my_coop.menu_easy_my_coop_config" sequence="420"/>
</odoo> </odoo>

31
easy_my_coop_loan/views/partner_view.xml

@ -1,11 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Coop IT Easy
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo> <odoo>
<record id="view_partner_form_loan_issue" model="ir.ui.view"> <record id="view_partner_form_loan_issue" model="ir.ui.view">
<field name="name">res.partner.form.loan.issue</field> <field name="name">res.partner.form.loan.issue</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="easy_my_coop.view_partner_form_easy_my_coop"/> <field name="inherit_id" ref="easy_my_coop.view_partner_form_easy_my_coop"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<page name="share_subscription" position="after">
<page name="share_subscription" position="after">
<page string="Loan issue lines" name="loan_issue_lines" groups="easy_my_coop.group_easy_my_coop_user"> <page string="Loan issue lines" name="loan_issue_lines" groups="easy_my_coop.group_easy_my_coop_user">
<group>
<field name="is_loaner"/>
</group>
<field name="loan_line_ids"> <field name="loan_line_ids">
<tree create="false" delete="false" edit="false"> <tree create="false" delete="false" edit="false">
<field name="loan_issue_id"/> <field name="loan_issue_id"/>
@ -20,4 +28,23 @@
</page> </page>
</field> </field>
</record> </record>
</odoo>
<record id="view_res_partner_loaner_filter" model="ir.ui.view">
<field name="name">res.partner.select</field>
<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 string="Loaners" name="loaners" domain="[('is_loaner','=',1)]" help="Loaning Partners"/>
</xpath>
</field>
</record>
<record id="action_loaners" model="ir.actions.act_window">
<field name="name">Loaners</field>
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_loaners':1}</field>
</record>
</odoo>

1
easy_my_coop_taxshelter_report/__openerp__.py

@ -19,6 +19,7 @@
# #
############################################################################## ##############################################################################
{ {
# todo check ir model access
"name": "Easy My Coop tax shelter report", "name": "Easy My Coop tax shelter report",
"version": "1.0", "version": "1.0",
"depends": ["easy_my_coop"], "depends": ["easy_my_coop"],

Loading…
Cancel
Save