Skip to content

Commit

Permalink
fixup! [MIG] pingen: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaniszewska-dev committed Jan 31, 2023
1 parent 2385ec2 commit 3e2c5f0
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 25 deletions.
28 changes: 22 additions & 6 deletions pingen/models/base_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@
from odoo import fields, models


class BaseConfigSettings(models.TransientModel):
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

pingen_clientid = fields.Char(related="company_id.pingen_clientid")
pingen_client_secretid = fields.Char(related="company_id.pingen_client_secretid")
pingen_organization = fields.Char(related="company_id.pingen_organization")
pingen_webhook_secret = fields.Char(related="company_id.pingen_webhook_secret")
pingen_staging = fields.Boolean(related="company_id.pingen_staging")
pingen_clientid = fields.Char(
string="Pingen Client ID", related="company_id.pingen_clientid", readonly=False
)
pingen_client_secretid = fields.Char(
string="Pingen Client Secret ID",
related="company_id.pingen_client_secretid",
readonly=False,
)
pingen_organization = fields.Char(
string="Pingen organization",
related="company_id.pingen_organization",
readonly=False,
)
pingen_webhook_secret = fields.Char(
string="Pingen webhook secret",
related="company_id.pingen_webhook_secret",
readonly=False,
)
pingen_staging = fields.Boolean(
string="Pingen Staging", related="company_id.pingen_staging", readonly=False
)
50 changes: 36 additions & 14 deletions pingen/views/base_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,42 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@name='integration']" position='inside'>
<div class="col-12 col-lg-6 o_setting_box" id="pingen_integraton">
<div class="o_setting_left_pane">
<field name="pingen_clientid" groups="base.group_system" />
<field
name="pingen_client_secretid"
groups="base.group_system"
/>
<field name="pingen_organization" groups="base.group_system" />
<field
name="pingen_webhook_secret"
groups="base.group_system"
/>
<field name="pingen_staging" groups="base.group_system" />
<xpath expr="//div[@name='integration']" position='after'>
<h2>Pingen</h2>
<div class="o_settings_container" id="pingen_integraton">
<div
id="pingen_configuration_settings"
class="o_settings_box col-12 col-lg-6"
>
<div class="mt16 row">
<label class="o_form_label col-3" for="pingen_clientid" />
<field name="pingen_clientid" />
</div>
<div class="mt16 row">
<label
class="o_form_label col-3"
for="pingen_client_secretid"
/>
<field name="pingen_client_secretid" />
</div>
<div class="mt16 row">
<label
class="o_form_label col-3"
for="pingen_organization"
/>
<field name="pingen_organization" />
</div>
<div class="mt16 row">
<label
class="o_form_label col-3"
for="pingen_webhook_secret"
/>
<field name="pingen_webhook_secret" />
</div>
<div class="mt16 row">
<label class="o_form_label col-3" for="pingen_staging" />
<field name="pingen_staging" />
</div>
</div>
</div>
</xpath>
Expand Down
9 changes: 4 additions & 5 deletions pingen/views/pingen_document_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
string="Update the letter's informations"
icon="fa-refresh"
/>
<field
<field
name="state"
widget="statusbar"
statusbar_visible="pending,pushed,sent"
Expand Down Expand Up @@ -162,16 +162,15 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search>
<!-- FIXME: Invalid view pingen.document.search definition in pingen/views/pingen_document_view.xml
<filter name="pending" string="Pending" domain="[('state','=','pending')]" />
<filter name="pushed" string="Pushed" domain="[('state','=','pushed')]" />
<filter
name="in_sendcenter"
string="In Sendcenter"
domain="[('state','=','sendcenter')]"
/>
<filter icon="kanban-apply" string="Sent" domain="[('state','=','sent')]" />
<filter icon="kanban-stop" string="Error" domain="[('state','=','error')]" />
<filter name="sent" string="Sent" domain="[('state','=','sent')]" />
<filter name="error" string="Error" domain="[('state','=','error')]" />
<filter
name="error"
string="Pingen Error"
Expand All @@ -183,7 +182,7 @@
domain="[('state','=','canceled')]"
/>
<separator orientation="vertical" />
<field name="attachment_id" /> -->
<field name="attachment_id" />
</search>
</field>
</record>
Expand Down

0 comments on commit 3e2c5f0

Please sign in to comment.