Skip to content

Commit

Permalink
[MIG] sale_order_invoice_date: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MS-OSI committed Jan 15, 2025
1 parent 82652e8 commit 6ff8996
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
6 changes: 5 additions & 1 deletion sale_order_invoice_date/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Sale Order Invoice Date

|badge1| |badge2| |badge3| |badge4| |badge5|

Display the invoice date on Sales Order analysis reports.
Display the invoice date on Sales Order analysis reports, Sales Order form, and tree view.

The invoice date is considered to be the latest invoice date linked to fully
invoiced sales.
Expand Down Expand Up @@ -60,6 +60,10 @@ Contributors

* Iván Todorovich <[email protected]>

* `Open Source Integrators <https://www.opensourceintegrators.com/>`_

* Murtuza Saleh <[email protected]>

Maintainers
~~~~~~~~~~~

Expand Down
7 changes: 5 additions & 2 deletions sale_order_invoice_date/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
{
"name": "Sale Order Invoice Date",
"summary": "Display the invoice date on Sales Order analysis reports",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"maintainers": ["ivantodorovich"],
"website": "https://github.com/OCA/sale-reporting",
"license": "AGPL-3",
"category": "Sales",
"depends": ["sale"],
"data": ["reports/sale_report.xml"],
"data": [
"reports/sale_report.xml",
"views/sale_order_view.xml",
],
"pre_init_hook": "pre_init_hook",
}
3 changes: 3 additions & 0 deletions sale_order_invoice_date/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* `Camptocamp <https://www.camptocamp.com>`_

* Iván Todorovich <[email protected]>
* `Open Source Integrators <https://www.opensourceintegrators.com/>`_

* Murtuza Saleh <[email protected]>
2 changes: 1 addition & 1 deletion sale_order_invoice_date/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Display the invoice date on Sales Order analysis reports.
Display the invoice date on Sales Order analysis reports, Sales Order form, and tree view.

The invoice date is considered to be the latest invoice date linked to fully
invoiced sales.
14 changes: 8 additions & 6 deletions sale_order_invoice_date/reports/sale_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ class SaleReport(models.Model):

invoice_date = fields.Date(readonly=True)

def _select_sale(self, fields=None):
res = super()._select_sale(fields=fields)
return f"{res}, l.invoice_date"
def _select_sale(self):
res = super()._select_sale()
res += ", l.invoice_date"
return res

def _group_by_sale(self, groupby=""):
res = super()._group_by_sale(groupby=groupby)
return f"{res}, l.invoice_date"
def _group_by_sale(self):
res = super()._group_by_sale()
res += ", l.invoice_date"
return res
17 changes: 17 additions & 0 deletions sale_order_invoice_date/views/sale_order_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<odoo>

<record id="view_order_form_inherit_so_invoice_date" model="ir.ui.view">
<field name="name">sale.order.form.inherit.so.invoice.date</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='sale_info']//field[@name='invoice_status']" position="after">
<field name="invoice_date" states="sale,done" groups="base.group_no_one"/>
</xpath>
<xpath expr="//field[@name='order_line']//tree//field[@name='price_subtotal']" position="after">
<field name="invoice_date" optional="hide"/>
</xpath>
</field>
</record>

</odoo>

0 comments on commit 6ff8996

Please sign in to comment.