[IMP] account_edi_proxy_client: Debug views added

Added views and menuitems for account_edi.document
and account_edi_proxy_client.user, so that our technical team
will be autonomous in its investigations.

Task link: https://www.odoo.com/web#model=project.task&id=3204255
Task-3204255

closes odoo/odoo#115751

X-original-commit: 5e771b131e85b42a747936daf698f62fe2b125b5
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
This commit is contained in:
Paolo Gatti (pgi)
2023-03-18 03:32:40 +01:00
parent 49e2a5b995
commit 2a3d65e3e9
5 changed files with 148 additions and 1 deletions
@@ -16,6 +16,8 @@
<field name="arch" type="xml">
<field name="state" position="before">
<field name="edi_state" optional="hide"/>
<field name="edi_blocking_level" optional="hide"/>
<field name="edi_error_message" optional="hide"/>
</field>
</field>
</record>
@@ -27,6 +29,21 @@
<field name="arch" type="xml">
<field name="state" position="before">
<field name="edi_state" optional="hide"/>
<field name="edi_blocking_level" optional="hide"/>
<field name="edi_error_message" optional="hide"/>
</field>
</field>
</record>
<record id="view_in_invoice_refund_tree_inherit" model="ir.ui.view">
<field name="name">account.move.tree.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_in_invoice_refund_tree" />
<field name="arch" type="xml">
<field name="state" position="before">
<field name="edi_state" optional="hide"/>
<field name="edi_blocking_level" optional="hide"/>
<field name="edi_error_message" optional="hide"/>
</field>
</field>
</record>
@@ -37,7 +54,11 @@
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="//search/group/filter[@name='status']" position="after">
<filter string="Electronic invoicing state" name="edi_state" context="{'group_by': 'edi_state'}" />
<filter string="Electronic invoicing state" name="edi_state" groups="base.group_no_one"
context="{'group_by': 'edi_state'}"/>
<separator/>
<filter string="Electronic invoicing processing needed" name="edi_to_process" groups="base.group_no_one"
domain="[('edi_state', 'in', [('to_send'), ('to_cancel')])]"/>
</xpath>
</field>
</record>
@@ -18,6 +18,7 @@ Odoo database.
'data': [
'security/ir.model.access.csv',
'security/account_edi_proxy_client_security.xml',
'views/account_edi_proxy_user_views.xml',
],
'installable': True,
'license': 'LGPL-3',
@@ -49,6 +49,7 @@ class AccountEdiProxyClientUser(models.Model):
edi_format_code = fields.Char(related='edi_format_id.code', readonly=True)
edi_identification = fields.Char(required=True, help="The unique id that identifies this user for on the edi format, typically the vat")
private_key = fields.Binary(required=True, attachment=False, groups="base.group_system", help="The key to encrypt all the user's data")
private_key_filename = fields.Char(compute='_compute_private_key_filename')
refresh_token = fields.Char(groups="base.group_system")
_sql_constraints = [
@@ -56,6 +57,10 @@ class AccountEdiProxyClientUser(models.Model):
('unique_edi_identification_per_for', 'unique(edi_identification, edi_format_id)', 'This edi identification is already assigned to a user'),
]
def _compute_private_key_filename(self):
for record in self:
record.private_key_filename = f'{record.id_client}_{record.edi_identification}.key'
def _get_demo_state(self):
demo_state = self.env['ir.config_parameter'].sudo().get_param('account_edi_proxy_client.demo', False)
return 'prod' if demo_state in ['prod', False] else 'test' if demo_state == 'test' else 'demo'
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_form_account_edi_proxy_client_user" model="ir.ui.view">
<field name="name">EDI Proxy User</field>
<field name="model">account_edi_proxy_client.user</field>
<field name="arch" type="xml">
<form string="Account Journal">
<sheet>
<group>
<group>
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
<field name="edi_format_id" readonly="1" options="{'no_open': True}"/>
<field name="id_client" readonly="1"/>
<field name="edi_identification" readonly="1"/>
<field name="private_key_filename" invisible="1"/>
<field name="private_key" widget="binary" filename="private_key_filename" readonly="1"/>
<field name="refresh_token" readonly="1"/>
</group>
<group/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_tree_account_edi_proxy_client_user" model="ir.ui.view">
<field name="name">EDI Proxy Users</field>
<field name="model">account_edi_proxy_client.user</field>
<field name="arch" type="xml">
<tree create="false" delete="false" edit="false">
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
<field name="edi_format_id" readonly="1"/>
<field name="id_client" readonly="1"/>
<field name="edi_identification" readonly="1"/>
<field name="private_key_filename" invisible="1"/>
<field name="private_key" widget="binary" filename="private_key_filename" readonly="1"/>
<field name="refresh_token" readonly="1"/>
</tree>
</field>
</record>
<record id="action_tree_account_edi_proxy_client_user" model="ir.actions.act_window">
<field name="name">EDI Proxy User</field>
<field name="res_model">account_edi_proxy_client.user</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_tree_account_edi_proxy_client_user"/>
</record>
<menuitem name="EDI Proxy Users"
sequence="2"
parent="account.menu_finance_configuration"
id="menu_account_proxy_client_user"
action="action_tree_account_edi_proxy_client_user"
groups="base.group_no_one"/>
</data>
</odoo>
+62
View File
@@ -83,6 +83,67 @@
</field>
</record>
<record id="view_invoice_tree_inherit" model="ir.ui.view">
<field name="name">account.move.tree.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_invoice_tree" />
<field name="arch" type="xml">
<field name="state" position="before">
<field name="l10n_it_edi_transaction" optional="hide"/>
<field name="l10n_it_edi_attachment_id" optional="hide"/>
</field>
</field>
</record>
<record id="view_account_invoice_filter" model="ir.ui.view">
<field name="name">account.invoice.select.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account_edi.view_account_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="//search/field[@name='journal_id']" position="after">
<field name="l10n_it_edi_transaction" groups="base.group_no_one"/>
<field name="l10n_it_edi_attachment_id" groups="base.group_no_one"/>
</xpath>
</field>
</record>
<record id="view_in_bill_tree_inherit" model="ir.ui.view">
<field name="name">account.move.tree.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_in_invoice_bill_tree" />
<field name="arch" type="xml">
<field name="state" position="before">
<field name="edi_state" optional="hide"/>
<field name="edi_blocking_level" optional="hide"/>
<field name="edi_error_message" optional="hide"/>
</field>
</field>
</record>
<record id="view_out_invoice_tree_inherit" model="ir.ui.view">
<field name="name">account.move.tree.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account_edi.view_out_invoice_tree_inherit" />
<field name="arch" type="xml">
<field name="state" position="before">
<field name="l10n_it_edi_transaction" optional="hide"/>
<field name="l10n_it_edi_attachment_id" optional="hide"/>
</field>
</field>
</record>
<record id="view_account_invoice_filter" model="ir.ui.view">
<field name="name">account.invoice.select.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account_edi.view_account_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="//search/field[@name='journal_id']" position="after">
<field name="l10n_it_edi_transaction" groups="base.group_no_one"/>
<field name="l10n_it_edi_attachment_id" groups="base.group_no_one"/>
</xpath>
</field>
</record>
<record id="account_invoice_form_l10n_it" model="ir.ui.view">
<field name="name">account.move.form.l10n.it</field>
<field name="model">account.move</field>
@@ -96,6 +157,7 @@
attrs="{'invisible': ['|', ('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund')), ('country_code', '!=', 'IT')]}">
<group>
<group>
<field name="l10n_it_edi_transaction" groups="base.group_no_one" readonly="1"/>
<field name="l10n_it_stamp_duty"/>
<field name="l10n_it_ddt_id"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>