[MIG] account_quotation_sale_order_invoice_title: Migration to 18.0

This commit is contained in:
Stéphan Sainléger
2026-03-17 23:04:52 +01:00
parent d6c6872c5c
commit 8cef75a9b3
11 changed files with 26 additions and 79 deletions

View File

@@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
from . import models from . import models
from . import wizard from . import wizard

View File

@@ -1,59 +1,15 @@
# -*- coding: utf-8 -*- # Copyright 2025 Elabore
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
"name": "Account Quotation Sale Order Invoice Title", "name": "Account Quotation Sale Order Invoice Title",
"category": "Account", "version": "18.0.1.0.0",
"version": "16.0.1.0", "category": "Accounting",
"summary": "Transfer the Receipt Lost value in invoices and account move lines", "summary": "Add title field in Quotations, Sale Orders and Invoices",
"author": "Elabore", "author": "Elabore",
"website": "https://git.elabore.coop/elabore/account-tools", "website": "https://git.elabore.coop/elabore/account-tools",
"installable": True, "license": "AGPL-3",
"application": False,
"auto_install": False,
"description": """
==========================================
Account Quotation Sale Order Invoice Title
==========================================
This module allows to add a title in Quotations, Sale Orders and Invoices.
When an invoice is created from a Sale Order, the title is transfered.
Installation
============
Just install account_quotation_sale_order_invoice_title, all dependencies will be installed by default.
Known issues / Roadmap
======================
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/elabore-coop/.../issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Elabore: `Icon <https://elabore.coop/web/image/res.company/1/logo?unique=f3db262>`_.
Contributors
------------
* Stéphan Sainléger <https://github.com/stephansainleger>
Funders
-------
The development of this module has been financially supported by:
* Elabore (https://elabore.coop)
* Datactivist (https://datactivist.coop)
Maintainer
----------
This module is maintained by ELABORE.
""",
"depends": [ "depends": [
"base",
"account", "account",
"sale", "sale",
], ],
@@ -63,5 +19,7 @@ This module is maintained by ELABORE.
"views/account_invoice_report.xml", "views/account_invoice_report.xml",
"views/sale_order_report.xml", "views/sale_order_report.xml",
], ],
"qweb": [], "installable": True,
"auto_install": False,
"application": False,
} }

View File

@@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
from . import account_move from . import account_move
from . import sale from . import sale

View File

@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*- from odoo import fields, models
from odoo import models, fields
class AccountMove(models.Model): class AccountMove(models.Model):
_inherit = 'account.move' _inherit = "account.move"
move_title = fields.Char(string="Invoice Title") move_title = fields.Char(string="Invoice Title")

View File

@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*- from odoo import fields, models
from odoo import models, fields
class SaleOrder(models.Model): class SaleOrder(models.Model):
@@ -9,6 +7,6 @@ class SaleOrder(models.Model):
so_title = fields.Char(string="Title") so_title = fields.Char(string="Title")
def _prepare_invoice(self): def _prepare_invoice(self):
res = super(SaleOrder, self)._prepare_invoice() res = super()._prepare_invoice()
res["move_title"] = self.so_title res["move_title"] = self.so_title
return res return res

View File

@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<template id="report_saleorder_document" inherit_id="sale.report_saleorder_document"> <template
id="report_saleorder_document"
inherit_id="sale.report_saleorder_document"
>
<xpath expr="//span[@t-field='doc.name']" position="after"> <xpath expr="//span[@t-field='doc.name']" position="after">
<div t-field="doc.so_title"></div> <div t-field="doc.so_title" />
</xpath> </xpath>
</template> </template>

View File

@@ -1,3 +1 @@
# -*- coding: utf-8 -*-
from . import sale_make_invoice_advance from . import sale_make_invoice_advance

View File

@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from odoo import models from odoo import models
@@ -7,8 +5,6 @@ class SaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv" _inherit = "sale.advance.payment.inv"
def _prepare_invoice_values(self, order, so_line): def _prepare_invoice_values(self, order, so_line):
res = super(SaleAdvancePaymentInv, self)._prepare_invoice_values( res = super()._prepare_invoice_values(order, so_line)
order, so_line
)
res["move_title"] = order.so_title res["move_title"] = order.so_title
return res return res