Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
57
account_invoice_transmit_method/views/account_move.xml
Normal file
57
account_invoice_transmit_method/views/account_move.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2022 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
Copyright 2021-2022 Camptocamp SA (https://www.camptocamp.com).
|
||||
@author: Iván Todorovich <ivan.todorovich@camptocamp.com>
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="view_move_form" model="ir.ui.view">
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form" />
|
||||
<field name="arch" type="xml">
|
||||
<!--
|
||||
For customer invoices, the field transmit_method_id is displayed
|
||||
at the top. For vendor bills, it is displayed in the 3rd tab.
|
||||
-->
|
||||
<div name="journal_div" position="after">
|
||||
<field
|
||||
name="transmit_method_id"
|
||||
widget="selection"
|
||||
invisible="move_type not in ('out_invoice', 'out_refund')"
|
||||
/>
|
||||
</div>
|
||||
<field name="invoice_source_email" position="after">
|
||||
<field
|
||||
name="transmit_method_id"
|
||||
widget="selection"
|
||||
invisible="move_type not in ('in_invoice', 'in_refund')"
|
||||
/>
|
||||
</field>
|
||||
<!--
|
||||
button name="action_invoice_sent" string="Send and Print"
|
||||
is used twice in the view:
|
||||
one with class="oe_highlight" and a second one without highlight
|
||||
The buttons should only be shown when the transmit method is
|
||||
E-mail or empty
|
||||
-->
|
||||
<xpath
|
||||
expr="//button[@name='action_invoice_sent' and hasclass('oe_highlight')]"
|
||||
position="attributes"
|
||||
>
|
||||
<attribute
|
||||
name="invisible"
|
||||
>state != 'posted' or is_being_sent or invoice_pdf_report_id or move_type not in ('out_invoice', 'out_refund') or transmit_method_code not in ('mail', False)</attribute>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[@name='action_invoice_sent' and not(hasclass('oe_highlight'))]"
|
||||
position="attributes"
|
||||
>
|
||||
<attribute
|
||||
name="invisible"
|
||||
>state != 'posted' or not is_being_sent and not invoice_pdf_report_id or move_type not in ('out_invoice', 'out_refund', 'in_invoice', 'in_refund') or transmit_method_code not in ('mail', False)</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
38
account_invoice_transmit_method/views/res_partner.xml
Normal file
38
account_invoice_transmit_method/views/res_partner.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2022 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
Copyright 2021-2022 Camptocamp SA (https://www.camptocamp.com).
|
||||
@author: Iván Todorovich <ivan.todorovich@camptocamp.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.view_partner_property_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_payment_term_id" position="after">
|
||||
<field name="customer_invoice_transmit_method_id" widget="selection" />
|
||||
</field>
|
||||
<field name="property_supplier_payment_term_id" position="after">
|
||||
<field name="supplier_invoice_transmit_method_id" widget="selection" />
|
||||
</field>
|
||||
<field name="child_ids" position="attributes">
|
||||
<attribute name="context" operation="update">
|
||||
{
|
||||
"default_customer_invoice_transmit_method_code": customer_invoice_transmit_method_code,
|
||||
"default_supplier_invoice_transmit_method_code": supplier_invoice_transmit_method_code,
|
||||
}
|
||||
</attribute>
|
||||
</field>
|
||||
<xpath
|
||||
expr="//field[@name='child_ids']/form//field[@name='email']"
|
||||
position="attributes"
|
||||
>
|
||||
<attribute
|
||||
name="required"
|
||||
>customer_invoice_transmit_method_code == 'mail' and type == 'invoice'</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
90
account_invoice_transmit_method/views/transmit_method.xml
Normal file
90
account_invoice_transmit_method/views/transmit_method.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="transmit_method_form" model="ir.ui.view">
|
||||
<field name="model">transmit.method</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<widget
|
||||
name="web_ribbon"
|
||||
title="Archived"
|
||||
bg_color="bg-danger"
|
||||
invisible="active"
|
||||
/>
|
||||
<div class="oe_title">
|
||||
<label for="name" />
|
||||
<h1>
|
||||
<field name="name" />
|
||||
</h1>
|
||||
</div>
|
||||
<group name="main">
|
||||
<group name="info">
|
||||
<field name="code" />
|
||||
</group>
|
||||
<group name="options">
|
||||
<field name="customer_ok" widget="boolean_toggle" />
|
||||
<field name="supplier_ok" widget="boolean_toggle" />
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="transmit_method_tree" model="ir.ui.view">
|
||||
<field name="model">transmit.method</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="name" />
|
||||
<field name="code" />
|
||||
<field name="customer_ok" widget="boolean_toggle" />
|
||||
<field name="supplier_ok" widget="boolean_toggle" />
|
||||
<field name="active" column_invisible="True" />
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="transmit_method_search" model="ir.ui.view">
|
||||
<field name="model">transmit.method</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field
|
||||
name="name"
|
||||
filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]"
|
||||
string="Name or Code"
|
||||
/>
|
||||
<filter
|
||||
name="customer_ok"
|
||||
string="Selectable on Customers"
|
||||
domain="[('customer_ok', '=', True)]"
|
||||
/>
|
||||
<filter
|
||||
name="supplier_ok"
|
||||
string="Selectable on Vendors"
|
||||
domain="[('supplier_ok', '=', True)]"
|
||||
/>
|
||||
<separator />
|
||||
<filter
|
||||
name="active"
|
||||
string="Archived"
|
||||
domain="[('active', '=' ,False)]"
|
||||
/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="transmit_method_action" model="ir.actions.act_window">
|
||||
<field name="name">Transmit Methods</field>
|
||||
<field name="res_model">transmit.method</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="transmit_method_menu"
|
||||
action="transmit_method_action"
|
||||
parent="account.account_management_menu"
|
||||
sequence="100"
|
||||
/>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user