houssine 5 years ago
parent
commit
19028603b2
  1. 1
      easy_my_coop/__manifest__.py
  2. 2
      easy_my_coop/demo/coop.xml
  3. 2
      easy_my_coop/views/account_invoice_view.xml
  4. 1
      easy_my_coop/views/cooperator_register_view.xml
  5. 2
      easy_my_coop/views/email_template_view.xml
  6. 26
      easy_my_coop/views/menus.xml
  7. 1
      easy_my_coop/views/operation_request_view.xml
  8. 1
      easy_my_coop/views/product_view.xml
  9. 8
      easy_my_coop/views/res_partner_view.xml
  10. 56
      easy_my_coop/views/subscription_request_view.xml
  11. 1
      easy_my_coop_loan/__manifest__.py
  12. 1
      easy_my_coop_loan/models/interest_line.py
  13. 2
      easy_my_coop_loan/models/loan.py
  14. 1
      easy_my_coop_loan/models/loan_issue_line.py
  15. 2
      easy_my_coop_loan/models/partner.py
  16. 28
      easy_my_coop_loan/views/loan_view.xml
  17. 12
      easy_my_coop_loan/views/menus.xml
  18. 1
      easy_my_coop_loan/views/term_view.xml

1
easy_my_coop/__manifest__.py

@ -43,6 +43,7 @@
'views/product_view.xml', 'views/product_view.xml',
'views/res_company_view.xml', 'views/res_company_view.xml',
'views/account_journal_view.xml', 'views/account_journal_view.xml',
'views/menus.xml',
'report/easy_my_coop_report.xml', 'report/easy_my_coop_report.xml',
'report/layout.xml', 'report/layout.xml',
'report/cooperator_invoice_G002.xml', 'report/cooperator_invoice_G002.xml',

2
easy_my_coop/demo/coop.xml

@ -34,7 +34,7 @@
</record> </record>
<record id="bank_account_houssine_demo" model="res.partner.bank"> <record id="bank_account_houssine_demo" model="res.partner.bank">
<field name="acc_number">BE68539007547034</field>
<field name="acc_number">FR7630001007941234567890185</field>
<field name="bank_name">Bank</field> <field name="bank_name">Bank</field>
<field name="partner_id" ref="res_partner_cooperator_2_demo"/> <field name="partner_id" ref="res_partner_cooperator_2_demo"/>
</record> </record>

2
easy_my_coop/views/account_invoice_view.xml

@ -42,8 +42,6 @@
<field name="act_window_id" ref="action_invoice_tree_coop"/> <field name="act_window_id" ref="action_invoice_tree_coop"/>
</record> </record>
<menuitem action="action_invoice_tree_coop" id="menu_action_invoice_tree_coop" parent="menu_easy_my_coop_main_coop" groups="easy_my_coop.group_easy_my_coop_user"/>
<record id="account.action_invoice_tree1" model="ir.actions.act_window"> <record id="account.action_invoice_tree1" model="ir.actions.act_window">
<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>

1
easy_my_coop/views/cooperator_register_view.xml

@ -74,5 +74,4 @@
<field name="search_view_id" ref="view_subscription_register_filter"/> <field name="search_view_id" ref="view_subscription_register_filter"/>
</record> </record>
<menuitem action="subscription_register_action" name="Subscription Register" id="menu_easy_my_coop_subscription_register" parent="menu_easy_my_coop_main_subscription" sequence="20"/>
</odoo> </odoo>

2
easy_my_coop/views/email_template_view.xml

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<menuitem name="Configuration" id="menu_easy_my_coop_config" parent="menu_main_easy_my_coop" sequence="80" />
<record model="ir.actions.act_window" <record model="ir.actions.act_window"
id="action_easy_my_coop_email_templates"> id="action_easy_my_coop_email_templates">
@ -12,5 +11,4 @@
<field name="search_view_id" ref="mail.view_email_template_search" /> <field name="search_view_id" ref="mail.view_email_template_search" />
</record> </record>
<menuitem id="menu_easy_my_coop_templates" parent="menu_easy_my_coop_config" action="action_easy_my_coop_email_templates" sequence="10" groups="group_easy_my_coop_manager" />
</odoo> </odoo>

26
easy_my_coop/views/menus.xml

@ -0,0 +1,26 @@
<?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>
<menuitem name="Easy-My Coop" id="menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_user" sequence="40" />
<menuitem name="Share Management" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_manager" sequence="10" />
<menuitem name="Subscriptions" id="menu_easy_my_coop_subscription_request" action="subscription_request_action" parent="menu_easy_my_coop_main_subscription" sequence="110" />
<menuitem name="Register Payment" id="menu_action_invoice_tree_coop" action="action_invoice_tree_coop" parent="menu_easy_my_coop_main_subscription" groups="easy_my_coop.group_easy_my_coop_user" sequence="130" />
<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_manager" 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="group_easy_my_coop_super_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" />
<menuitem name="Company representative" id="menu_easy_my_coop_company_representative" action="action_company_representative_form" parent="menu_easy_my_coop_main_coop" sequence="220" />
<menuitem name="Reporting" id="menu_easy_my_coop_main_reporting" parent="menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_manager" sequence="30" />
<menuitem name="Configuration" id="menu_easy_my_coop_config" parent="menu_main_easy_my_coop" sequence="40" />
<menuitem name="Share type" id="menu_easy_my_coop_share_product" action="share_product_action" parent="menu_easy_my_coop_config" sequence="410" />
<menuitem name="Mail Templates" id="menu_easy_my_coop_templates" action="action_easy_my_coop_email_templates" parent="menu_easy_my_coop_config" groups="group_easy_my_coop_manager" sequence="430" />
</odoo>

1
easy_my_coop/views/operation_request_view.xml

@ -103,5 +103,4 @@
<field name="view_id" ref="operation_request_tree"/> <field name="view_id" ref="operation_request_tree"/>
</record> </record>
<menuitem action="operation_request_action" name="Operation request" id="menu_easy_my_coop_operation_request" parent="menu_easy_my_coop_main_subscription" sequence="30" groups="easy_my_coop.group_easy_my_coop_manager"/>
</odoo> </odoo>

1
easy_my_coop/views/product_view.xml

@ -53,7 +53,6 @@
</field> </field>
</record> </record>
<menuitem action="share_product_action" name="Share type" id="menu_easy_my_coop_share_product" parent="menu_easy_my_coop_main_subscription" sequence="20"/>
<!-- overriding product views to not display share product in the purchase and sale views--> <!-- overriding product views to not display share product in the purchase and sale views-->

8
easy_my_coop/views/res_partner_view.xml

@ -92,8 +92,6 @@
</field> </field>
</record> </record>
<menuitem name="Cooperators" id="menu_easy_my_coop_main_coop" parent="menu_main_easy_my_coop" sequence="5" />
<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="name">Cooperator</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
@ -114,8 +112,6 @@
</field> </field>
</record> </record>
<menuitem id="menu_easy_my_coop_cooperator" name="Cooperators" parent="menu_easy_my_coop_main_coop" action="action_partner_cooperator_form" sequence="100"/>
<record id="action_partner_cooperator_candidate_form" model="ir.actions.act_window"> <record id="action_partner_cooperator_candidate_form" model="ir.actions.act_window">
<field name="name">Cooperator candidates</field> <field name="name">Cooperator candidates</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
@ -136,8 +132,6 @@
</field> </field>
</record> </record>
<menuitem id="menu_easy_my_coop_cooperator_candidate" name="Cooperator Candidates" parent="menu_easy_my_coop_main_coop" action="action_partner_cooperator_candidate_form" sequence="150"/>
<record id="action_company_representative_form" model="ir.actions.act_window"> <record id="action_company_representative_form" model="ir.actions.act_window">
<field name="name">Company representative</field> <field name="name">Company representative</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
@ -157,8 +151,6 @@
</field> </field>
</record> </record>
<menuitem id="menu_easy_my_coop_company_representative" name="Company representative" parent="menu_easy_my_coop_main_coop" action="action_company_representative_form" sequence="160"/>
<record id="remove_partner_follower" model="ir.ui.view"> <record id="remove_partner_follower" model="ir.ui.view">
<field name="name">res.partner.remove.follower.inherit</field> <field name="name">res.partner.remove.follower.inherit</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>

56
easy_my_coop/views/subscription_request_view.xml

@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<odoo> <odoo>
<menuitem name="Easy-My Coop" id="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_easy_my_coop_user"/>
<menuitem name="Subscription" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" sequence="10" groups="easy_my_coop.group_easy_my_coop_manager"/>
<menuitem name="Reporting" id="menu_easy_my_coop_main_reporting" parent="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_easy_my_coop_manager"/>
<record id="subscription_request_tree" model="ir.ui.view"> <record id="subscription_request_tree" model="ir.ui.view">
<field name="name">subscription.request.tree</field> <field name="name">subscription.request.tree</field>
<field name="model">subscription.request</field> <field name="model">subscription.request</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Cooperator Subscriptions Request" colors="red:validated == False; blue:state in ('draft');grey: state in ('done')">
<tree string="Subscription Requests" colors="red:validated == False; blue:state in ('draft'); grey: state in ('done')">
<field name="name"/> <field name="name"/>
<field name="company_name"/>
<field name="date" string="Request Date"/> <field name="date" string="Request Date"/>
<field name="type"/> <field name="type"/>
<field name="share_short_name" string="Share Type"/> <field name="share_short_name" string="Share Type"/>
@ -107,10 +105,10 @@
<search string="Search Subscription Request"> <search string="Search Subscription Request">
<field name="name"/> <field name="name"/>
<separator/> <separator/>
<filter string="draft" name="state_draft" domain="[('state','=','draft')]"/>
<filter string="done" name="state_done" domain="[('state','=','done')]"/>
<filter string="Draft" name="state_draft" domain="[('state','=','draft')]"/>
<filter string="Done" name="state_done" domain="[('state','=','done')]"/>
<separator/> <separator/>
<filter string="Unvalid" name="Unvalid" domain="[('validated', '=', False)]"/>
<filter string="Not Validated" name="Not Validated" domain="[('validated', '=', False)]"/>
<group expand="0" name="group_by" string="Group By"> <group expand="0" name="group_by" string="Group By">
<filter name="request_type" string="Request type" context="{'group_by' : 'type'}" /> <filter name="request_type" string="Request type" context="{'group_by' : 'type'}" />
<filter name="date_month" string="Date Month" context="{'group_by': 'date'}"/> <filter name="date_month" string="Date Month" context="{'group_by': 'date'}"/>
@ -120,54 +118,15 @@
</record> </record>
<record id="subscription_request_action" model="ir.actions.act_window"> <record id="subscription_request_action" model="ir.actions.act_window">
<field name="name">Cooperator Subscription</field>
<field name="name">Subscriptions</field>
<field name="res_model">subscription.request</field> <field name="res_model">subscription.request</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="domain">[('is_company','=',False),('is_operation','=',False)]</field>
<field name="domain">[('is_operation','=',False)]</field>
<field name="context">{'default_source':'manual'}</field> <field name="context">{'default_source':'manual'}</field>
<field name="view_id" ref="subscription_request_tree"/> <field name="view_id" ref="subscription_request_tree"/>
<field name="search_view_id" ref="view_subscription_request_filter"/> <field name="search_view_id" ref="view_subscription_request_filter"/>
</record> </record>
<menuitem action="subscription_request_action" name="Cooperator Subscription" id="menu_easy_my_coop_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="10"/>
<record id="company_subscription_request_tree" model="ir.ui.view">
<field name="name">subscription.request.tree</field>
<field name="model">subscription.request</field>
<field name="arch" type="xml">
<tree string="Company Cooperator Subscriptions Request" colors="red:validated == False; blue:state in ('draft');grey: state in ('done')">
<field name="company_name"/>
<field name="name"/>
<field name="date" string="Request Date"/>
<field name="type"/>
<field name="share_short_name" string="Share Type"/>
<field name="ordered_parts" string="Quantity" sum="Total ordered parts"/>
<field name="subscription_amount" sum="Total amount"/>
<field name="email"/>
<field name="iban"/>
<field name="partner_id"/>
<field name="source"/>
<field name="state"/>
<field name="validated" invisible="True"/>
<button type="object" title="Validate" aria-label="Validate" name="validate_subscription_request" attrs="{'invisible':['|',('state','!=','draft'),('validated','=',False)]}" icon="STOCK_MEDIA_PLAY" />
<button type="object" title="Block" aria-label="Block" name="block_subscription_request" states="draft" groups="easy_my_coop.group_easy_my_coop_user" icon="gtk-cancel"/>
<button type="object" title="Unblock" aria-label="Unblock" name="unblock_subscription_request" states="block" groups="easy_my_coop.group_easy_my_coop_manager" icon="gtk-jump-to"/>
</tree>
</field>
</record>
<record id="company_subscription_request_action" model="ir.actions.act_window">
<field name="name">Company Subscription</field>
<field name="res_model">subscription.request</field>
<field name="view_type">form</field>
<field name="domain">[('is_company','=',True),('is_operation','=',False)]</field>
<field name="context">{'default_is_company': True,'default_source':'manual'}</field>
<field name="view_id" ref="company_subscription_request_tree"/>
<field name="search_view_id" ref="view_subscription_request_filter"/>
</record>
<menuitem action="company_subscription_request_action" name="Company Subscription" id="menu_easy_my_coop_company_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="15"/>
<record id="share_line_form" model="ir.ui.view"> <record id="share_line_form" model="ir.ui.view">
<field name="name">share.line.form</field> <field name="name">share.line.form</field>
<field name="model">share.line</field> <field name="model">share.line</field>
@ -234,5 +193,4 @@
<field name="view_type">form</field> <field name="view_type">form</field>
</record> </record>
<menuitem action="share_line_action" name="Share lines" id="menu_easy_my_coop_share_line" parent="menu_easy_my_coop_main_subscription" sequence="20" groups="group_easy_my_coop_super_manager"/>
</odoo> </odoo>

1
easy_my_coop_loan/__manifest__.py

@ -21,6 +21,7 @@
'views/term_view.xml', 'views/term_view.xml',
'views/loan_view.xml', 'views/loan_view.xml',
'views/partner_view.xml', 'views/partner_view.xml',
'views/menus.xml',
'data/mail_template_data.xml', 'data/mail_template_data.xml',
], ],
'installable': True, 'installable': True,

1
easy_my_coop_loan/models/interest_line.py

@ -3,6 +3,7 @@ from odoo import fields, models
class LoanInterestLine(models.Model): class LoanInterestLine(models.Model):
_name = 'loan.interest.line' _name = 'loan.interest.line'
_description = "Loan Interest Line"
name = fields.Integer(string="Year", name = fields.Integer(string="Year",
required=True) required=True)

2
easy_my_coop_loan/models/loan.py

@ -7,6 +7,7 @@ _logger = logging.getLogger(__name__)
class LoanTerm(models.Model): class LoanTerm(models.Model):
_name = 'loan.term' _name = 'loan.term'
_description = 'Loan Term'
name = fields.Char(string="Name", name = fields.Char(string="Name",
required=True) required=True)
@ -16,6 +17,7 @@ class LoanTerm(models.Model):
class LoanIssue(models.Model): class LoanIssue(models.Model):
_name = 'loan.issue' _name = 'loan.issue'
_description = 'Loan Issue'
@api.multi @api.multi
def _compute_subscribed_amount(self): def _compute_subscribed_amount(self):

1
easy_my_coop_loan/models/loan_issue_line.py

@ -6,6 +6,7 @@ from odoo import api, fields, models
class LoanIssueLine(models.Model): class LoanIssueLine(models.Model):
_name = 'loan.issue.line' _name = 'loan.issue.line'
_description = 'Loan Issue Line'
_order = 'date desc, id' _order = 'date desc, id'
@api.multi @api.multi

2
easy_my_coop_loan/models/partner.py

@ -6,4 +6,4 @@ class ResPartner(models.Model):
loan_line_ids = fields.One2many('loan.issue.line', loan_line_ids = fields.One2many('loan.issue.line',
'partner_id', 'partner_id',
string="Name")
string="Loans")

28
easy_my_coop_loan/views/loan_view.xml

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<menuitem name="Loan Issue" id="menu_easy_my_coop_main_loan_issue" parent="easy_my_coop.menu_main_easy_my_coop" sequence="20" groups="easy_my_coop.group_easy_my_coop_user"/>
<record id="view_loan_issue_tree" model="ir.ui.view"> <record id="view_loan_issue_tree" model="ir.ui.view">
<field name="name">loan.issue.tree</field> <field name="name">loan.issue.tree</field>
<field name="model">loan.issue</field> <field name="model">loan.issue</field>
@ -99,14 +98,35 @@
</record> </record>
<record id="action_loan_issue" model="ir.actions.act_window"> <record id="action_loan_issue" model="ir.actions.act_window">
<field name="name">Loan issue</field>
<field name="type">ir.actions.act_window</field>
<field name="name">Loan Issues</field>
<field name="res_model">loan.issue</field> <field name="res_model">loan.issue</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<menuitem action="action_loan_issue" id="loan_issue_menu" parent="menu_easy_my_coop_main_loan_issue" sequence="25" />
<record id="action_follow_individual_loan" model="ir.actions.act_window">
<field name="name">Loans</field>
<field name="res_model">loan.issue.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record id="loan_issue_line_view_tree" model="ir.ui.view">
<field name="name">loan_issue_line_view_tree</field>
<field name="model">loan.issue.line</field>
<field name="arch" type="xml">
<tree string="Loans">
<field name="name"/>
<field name="partner_id"/>
<field name="loan_issue_id"/>
<field name="quantity"/>
<field name="face_value"/>
<field name="amount"/>
<field name="date"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_loan_issue_line_form" model="ir.ui.view"> <record id="view_loan_issue_line_form" model="ir.ui.view">
<field name="name">loan.issue.line.form</field> <field name="name">loan.issue.line.form</field>

12
easy_my_coop_loan/views/menus.xml

@ -0,0 +1,12 @@
<?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>
<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="Loans" id="individual_loan_menu" action="action_follow_individual_loan" parent="menu_easy_my_coop_main_loan_issue" sequence="120"/>
<menuitem name="Loan Term" id="loan_term_menu" action="action_loan_term" parent="easy_my_coop.menu_easy_my_coop_config" sequence="420"/>
</odoo>

1
easy_my_coop_loan/views/term_view.xml

@ -36,5 +36,4 @@
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<menuitem action="action_loan_term" id="loan_term_menu" parent="easy_my_coop.menu_easy_my_coop_config" sequence="5" />
</odoo> </odoo>
Loading…
Cancel
Save