Skip to content

Commit

Permalink
account_invoice_start_end_dates: add start/end dates in tree view of …
Browse files Browse the repository at this point in the history
…move lines

The 2 new fields are hidden by default
  • Loading branch information
alexis-via authored and henrybackman committed Sep 12, 2024
1 parent 0b46abe commit 5879beb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 26 deletions.
6 changes: 5 additions & 1 deletion account_invoice_start_end_dates/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"maintainers": ["alexis-via"],
"website": "https://github.com/OCA/account-closing",
"depends": ["account"],
"data": ["views/account_move.xml", "views/product_template.xml"],
"data": [
"views/account_move.xml",
"views/account_move_line.xml",
"views/product_template.xml",
],
"demo": ["demo/product_demo.xml"],
"installable": True,
}
26 changes: 1 addition & 25 deletions account_invoice_start_end_dates/views/account_move.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2013-2021 Akretion France (http://www.akretion.com/)
Copyright 2013-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">start_end_dates.view_move_line_form</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form" />
<field name="arch" type="xml">
<field name="date_maturity" position="after">
<field name="must_have_dates" invisible="1" />
<field name="start_date" required="must_have_dates" />
<field name="end_date" required="must_have_dates" />
</field>
</field>
</record>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">start_end_dates.view_move_line_tree</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree" />
<field name="arch" type="xml">
<field name="date_maturity" position="after">
<field name="must_have_dates" column_invisible="1" />
<field name="start_date" optional="hide" />
<field name="end_date" optional="hide" />
</field>
</field>
</record>
<record id="view_move_form" model="ir.ui.view">
<field name="name">start_end_dates.view_move_form</field>
<field name="model">account.move</field>
Expand Down
32 changes: 32 additions & 0 deletions account_invoice_start_end_dates/views/account_move_line.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2013-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">start_end_dates.view_move_line_form</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form" />
<field name="arch" type="xml">
<field name="date_maturity" position="after">
<field name="must_have_dates" invisible="1" />
<field name="start_date" required="must_have_dates" />
<field name="end_date" required="must_have_dates" />
</field>
</field>
</record>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">start_end_dates.view_move_line_tree</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree" />
<field name="arch" type="xml">
<field name="date_maturity" position="after">
<field name="must_have_dates" column_invisible="1" />
<field name="start_date" optional="hide" />
<field name="end_date" optional="hide" />
</field>
</field>
</record>
</odoo>

0 comments on commit 5879beb

Please sign in to comment.