[IMP] pingen: pre-commit stuff

This commit is contained in:
Anna Janiszewska
2023-01-26 12:55:11 +01:00
parent eb4a9f3b5a
commit 0529340243
17 changed files with 471 additions and 385 deletions

View File

@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="base_config_settings_inherit" model="ir.ui.view">
<field name="name">base.config.settings.inherit</field>
<field name="inherit_id" ref="base_setup.view_general_configuration"/>
<field name="inherit_id" ref="base_setup.view_general_configuration" />
<field name="model">base.config.settings</field>
<field name="arch" type="xml">
<group name="report" position="before">
<group string="Pingen Integration">
<field name="pingen_token" groups="base.group_system"/>
<field name="pingen_staging" groups="base.group_system"/>
<field name="pingen_token" groups="base.group_system" />
<field name="pingen_staging" groups="base.group_system" />
</group>
</group>
</field>

View File

@@ -1,16 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_attachment_form" model="ir.ui.view">
<field name="name">ir.attachment.pingen.view</field>
<field name="model">ir.attachment</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_attachment_form"/>
<field name="inherit_id" ref="base.view_attachment_form" />
<field name="arch" type="xml">
<xpath expr="//group/group[2]" position="after">
<group string="Pingen info" groups="base.group_no_one">
<field name="send_to_pingen"/>
<field name="pingen_send" attrs="{'required': [('send_to_pingen', '=', True)]}"/>
<field name="pingen_speed" attrs="{'required': [('pingen_send', '=', True)]}"/>
<field name="send_to_pingen" />
<field
name="pingen_send"
attrs="{'required': [('send_to_pingen', '=', True)]}"
/>
<field
name="pingen_speed"
attrs="{'required': [('pingen_send', '=', True)]}"
/>
<field name="pingen_color" />
</group>
</xpath>
@@ -18,10 +24,11 @@
</record>
<act_window
context="{'search_default_attachment_id': [active_id], 'default_attachment_id': active_id}"
id="act_attachment_to_pingen_document"
name="Pingen Document"
groups=""
res_model="pingen.document"
src_model="ir.attachment"/>
context="{'search_default_attachment_id': [active_id], 'default_attachment_id': active_id}"
id="act_attachment_to_pingen_document"
name="Pingen Document"
groups=""
res_model="pingen.document"
src_model="ir.attachment"
/>
</odoo>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_pingen_document_tree" model="ir.ui.view">
@@ -7,12 +7,12 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Pingen Document">
<field name="name"/>
<field name="datas_fname"/>
<field name="pingen_send"/>
<field name="pingen_speed"/>
<field name="pingen_color"/>
<field name="state"/>
<field name="name" />
<field name="datas_fname" />
<field name="pingen_send" />
<field name="pingen_speed" />
<field name="pingen_color" />
<field name="state" />
</tree>
</field>
</record>
@@ -24,88 +24,127 @@
<field name="arch" type="xml">
<form string="Pingen Document">
<header>
<field name="state" widget="statusbar"
statusbar_visible="pending,pushed,sent"
statusbar_colors='{"error":"red","pingen_error":"red","canceled":"grey","pushed":"blue","sent":"green"}'/>
<field
name="state"
widget="statusbar"
statusbar_visible="pending,pushed,sent"
statusbar_colors='{"error":"red","pingen_error":"red","canceled":"grey","pushed":"blue","sent":"green"}'
/>
</header>
<group colspan="4" col="6">
<field name="name" readonly="True"/>
<field name="type" readonly="True"/>
<field name="company_id" readonly="True" groups="base.group_multi_company" widget="selection"/>
<field name="name" readonly="True" />
<field name="type" readonly="True" />
<field
name="company_id"
readonly="True"
groups="base.group_multi_company"
widget="selection"
/>
</group>
<notebook colspan="4">
<page string="Pingen.com">
<separator string="Options" colspan="4"/>
<separator string="Options" colspan="4" />
<newline />
<group col="2" colspan="2">
<field name="pingen_send" attrs="{'readonly': [('state', 'in', ['sendcenter', 'sent'])]}"/>
<field name="pingen_speed" attrs="{'readonly': [('state', 'in', ['sendcenter', 'sent'])], 'required': [('pingen_send', '=', True)]}"/>
<field name="pingen_color" attrs="{'readonly': [('state', 'in', ['sendcenter', 'sent'])]}"/>
<field
name="pingen_send"
attrs="{'readonly': [('state', 'in', ['sendcenter', 'sent'])]}"
/>
<field
name="pingen_speed"
attrs="{'readonly': [('state', 'in', ['sendcenter', 'sent'])], 'required': [('pingen_send', '=', True)]}"
/>
<field
name="pingen_color"
attrs="{'readonly': [('state', 'in', ['sendcenter', 'sent'])]}"
/>
</group>
<separator string="Dates" colspan="4"/>
<separator string="Dates" colspan="4" />
<newline />
<group col="2" colspan="2">
<field name="push_date"/>
<field name="push_date" />
</group>
<group colspan="4" attrs="{'invisible': [('last_error_message', '=', False)]}">
<separator string="Errors" colspan="4"/>
<group
colspan="4"
attrs="{'invisible': [('last_error_message', '=', False)]}"
>
<separator string="Errors" colspan="4" />
<newline />
<group col="2" colspan="2">
<field nolabel="1" name="last_error_message"/>
<field nolabel="1" name="last_error_message" />
</group>
</group>
<group colspan="4" attrs="{'invisible': [('state', 'not in', ['sendcenter', 'sent'])]}">
<separator string="Sendcenter" colspan="4"/>
<group
colspan="4"
attrs="{'invisible': [('state', 'not in', ['sendcenter', 'sent'])]}"
>
<separator string="Sendcenter" colspan="4" />
<newline />
<group col="4" colspan="2">
<field colspan="4" name="post_status"/>
<field colspan="4" name="post_status" />
<group col="3" colspan="2">
<field name="cost"/>
<field colspan="1" nolabel="1" name="currency_id"/>
<field name="cost" />
<field colspan="1" nolabel="1" name="currency_id" />
</group>
<newline/>
<field name="parsed_address"/>
<field name="country_id"/>
<field name="send_date"/>
<field name="pages"/>
<newline />
<field name="parsed_address" />
<field name="country_id" />
<field name="send_date" />
<field name="pages" />
</group>
</group>
<separator string="Actions" colspan="4"/>
<separator string="Actions" colspan="4" />
<newline />
<group col="2" colspan="2">
<button name="push_to_pingen" type="object"
states="pending"
string="Push to pingen.com" icon="fa-upload"/>
<button name="ask_pingen_send" type="object"
states="pushed"
string="Ask pingen.com to send the document" icon="fa-share"/>
<button name="resolve_error" type="object"
states="error,pingen_error"
string="Errors resolved" icon="fa-repeat"/>
<button name="update_post_infos" type="object"
states="sendcenter"
string="Update the letter's informations" icon="fa-refresh"/>
<button
name="push_to_pingen"
type="object"
states="pending"
string="Push to pingen.com"
icon="fa-upload"
/>
<button
name="ask_pingen_send"
type="object"
states="pushed"
string="Ask pingen.com to send the document"
icon="fa-share"
/>
<button
name="resolve_error"
type="object"
states="error,pingen_error"
string="Errors resolved"
icon="fa-repeat"
/>
<button
name="update_post_infos"
type="object"
states="sendcenter"
string="Update the letter's informations"
icon="fa-refresh"
/>
</group>
</page>
<page string="Attachment">
<group col="4" colspan="4">
<separator string="Data" colspan="4"/>
<separator string="Data" colspan="4" />
<newline />
<group col="2" colspan="4" attrs="{'invisible':[('type','=','url')]}">
<field name="datas" filename="datas_fname" readonly="True"/>
<field name="datas_fname" select="1" readonly="True"/>
<field name="datas" filename="datas_fname" readonly="True" />
<field name="datas_fname" select="1" readonly="True" />
</group>
<group col="2" colspan="4" attrs="{'invisible':[('type','=','binary')]}">
<field name="url" widget="url" readonly="True"/>
<field name="url" widget="url" readonly="True" />
</group>
</group>
<group col="2" colspan="4">
<separator string="Attached To" colspan="2"/>
<field name="attachment_id"/>
<separator string="Attached To" colspan="2" />
<field name="attachment_id" />
</group>
</page>
</notebook>
@@ -119,28 +158,30 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Pingen Document">
<filter icon="terp-project"
string="Pending"
domain="[('state','=','pending')]"/>
<filter icon="terp-stage"
string="Pushed"
domain="[('state','=','pushed')]"/>
<filter icon="gtk-print"
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 icon="STOCK_NO"
string="Pingen Error"
domain="[('state','=','pingen_error')]"/>
<filter icon="terp-dialog-close"
string="Canceled"
domain="[('state','=','canceled')]"/>
<separator orientation="vertical"/>
<filter
icon="terp-project"
string="Pending"
domain="[('state','=','pending')]"
/>
<filter icon="terp-stage" string="Pushed" domain="[('state','=','pushed')]" />
<filter
icon="gtk-print"
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
icon="STOCK_NO"
string="Pingen Error"
domain="[('state','=','pingen_error')]"
/>
<filter
icon="terp-dialog-close"
string="Canceled"
domain="[('state','=','canceled')]"
/>
<separator orientation="vertical" />
<field name="attachment_id" />
</search>
</field>
@@ -152,9 +193,9 @@
<field name="res_model">pingen.document</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_pingen_document_search"/>
<field name="search_view_id" ref="view_pingen_document_search" />
</record>
<menuitem action="action_pingen_document" id="menu_pingen_document"/>
<menuitem action="action_pingen_document" id="menu_pingen_document" />
</odoo>