Browse Source

[ADD] emcc: account account bindings

pull/115/head
robin.keunen 4 years ago
parent
commit
a8d3276ed3
  1. 9
      easy_my_coop_connector/components/emc_bindings.py
  2. 1
      easy_my_coop_connector/models/__init__.py
  3. 20
      easy_my_coop_connector/models/account_account.py
  4. 1
      easy_my_coop_connector/security/ir.model.access.csv
  5. 6
      easy_my_coop_connector/views/actions.xml
  6. 28
      easy_my_coop_connector/views/emc_bindings.xml
  7. 37
      easy_my_coop_connector/views/menus.xml

9
easy_my_coop_connector/components/emc_bindings.py

@ -73,3 +73,12 @@ class AccountJournalBinding(models.Model):
internal_id = fields.Many2one(
comodel_name="account.journal", string="Internal ID", required=True
)
class AccountAccountBinding(models.Model):
_name = "emc.binding.account.account"
_inherit = "emc.binding"
internal_id = fields.Many2one(
comodel_name="account.account", string="Internal ID", required=True
)

1
easy_my_coop_connector/models/__init__.py

@ -1,3 +1,4 @@
from . import account_account
from . import account_invoice
from . import account_journal
from . import account_payment

20
easy_my_coop_connector/models/account_account.py

@ -0,0 +1,20 @@
# Copyright 2020 Coop IT Easy SCRL fs
# Robin Keunen <robin@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
from odoo import fields, models
_logger = logging.getLogger(__name__)
class AccountAccount(models.Model):
_inherit = "account.account"
binding_id = fields.One2many(
comodel_name="emc.binding.account.account",
inverse_name="internal_id",
string="Binding ID",
required=False,
)

1
easy_my_coop_connector/security/ir.model.access.csv

@ -5,3 +5,4 @@ access_emc_binding_product_template_administrator,access_emc_binding_product_tem
access_emc_binding_account_invoice_administrator,access_emc_binding_account_invoice_administrator,model_emc_binding_account_invoice,base.group_system,1,1,1,1
access_emc_binding_account_payment_administrator,access_emc_binding_account_payment_administrator,model_emc_binding_account_payment,base.group_system,1,1,1,1
access_emc_binding_account_journal_administrator,access_emc_binding_account_journal_administrator,model_emc_binding_account_journal,base.group_system,1,1,1,1
access_emc_binding_account_account_administrator,access_emc_binding_account_account_administrator,model_emc_binding_account_account,base.group_system,1,1,1,1

6
easy_my_coop_connector/views/actions.xml

@ -40,4 +40,10 @@
<field name="res_model">emc.binding.account.journal</field>
<field name="view_mode">tree,form</field>
</record>
<record id="emc_binding_account_account_action" model="ir.actions.act_window">
<field name="name">Account Bindings</field>
<field name="res_model">emc.binding.account.account</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

28
easy_my_coop_connector/views/emc_bindings.xml

@ -143,4 +143,32 @@
</tree>
</field>
</record>
<record id="emc_binding_account_account_view_form" model="ir.ui.view">
<field name="name">emc_binding_account_account_view_form</field>
<field name="model">emc.binding.account.account</field>
<field name="arch" type="xml">
<form string="emc_binding_account_account_form">
<sheet>
<group>
<field name="backend_id"/>
<field name="internal_id"/>
<field name="external_id"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="emc_binding_account_account_view_tree" model="ir.ui.view">
<field name="name">emc_binding_account_account_view_tree</field>
<field name="model">emc.binding.account.account</field>
<field name="arch" type="xml">
<tree string="emc_binding_account_account_tree">
<field name="backend_id"/>
<field name="internal_id"/>
<field name="external_id"/>
</tree>
</field>
</record>
</odoo>

37
easy_my_coop_connector/views/menus.xml

@ -19,41 +19,48 @@
groups="base.group_user"
sequence="1010"/>
<menuitem id="emc_binding_subscription_request_action_menu"
name="Subscription Request Bindings"
<menuitem id="emc_binding_product_template_action_menu"
name="Share Product Bindings"
parent="emc_connector_menu_menu"
action="emc_binding_subscription_request_action"
action="emc_binding_product_template_action"
groups="base.group_user"
sequence="1020"/>
<menuitem id="emc_binding_product_template_action_menu"
name="Share Product Bindings"
<menuitem id="emc_binding_account_journal_action_menu"
name="Journal Bindings"
parent="emc_connector_menu_menu"
action="emc_binding_product_template_action"
action="emc_binding_account_journal_action"
groups="base.group_user"
sequence="1030"/>
<menuitem id="emc_binding_account_invoice_action_menu"
name="Invoice Bindings"
<menuitem id="emc_binding_account_account_action_menu"
name="Account Bindings"
parent="emc_connector_menu_menu"
action="emc_binding_account_invoice_action"
action="emc_binding_account_account_action"
groups="base.group_user"
sequence="1040"/>
<menuitem id="emc_binding_account_payment_action_menu"
name="Payment Bindings"
<menuitem id="emc_binding_subscription_request_action_menu"
name="Subscription Request Bindings"
parent="emc_connector_menu_menu"
action="emc_binding_account_payment_action"
action="emc_binding_subscription_request_action"
groups="base.group_user"
sequence="1050"/>
<menuitem id="emc_binding_account_journal_action_menu"
name="Journal Bindings"
<menuitem id="emc_binding_account_invoice_action_menu"
name="Invoice Bindings"
parent="emc_connector_menu_menu"
action="emc_binding_account_journal_action"
action="emc_binding_account_invoice_action"
groups="base.group_user"
sequence="1060"/>
<menuitem id="emc_binding_account_payment_action_menu"
name="Payment Bindings"
parent="emc_connector_menu_menu"
action="emc_binding_account_payment_action"
groups="base.group_user"
sequence="1070"/>
<menuitem id="emc_history_import_action_menu"
name="Import Subscription Request History"
parent="emc_connector_menu_menu"

Loading…
Cancel
Save