Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions sale_order_line_client_order_ref/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
=====================================
Sale Order Line Cient Order Reference
=====================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e234948b1915d6c9360620f5cbb042f16fb99d45a6d04572a5adec42024f0b67
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_order_line_client_order_ref
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_order_line_client_order_ref
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
:alt: Try me on Runboat

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

This module provides the following features:

- Adds a Customer Order Number to sale order lines and propagates the
value to invoice lines.
- Allows the Customer Order Number to be displayed in both sale and
invoice reports.

This module is useful in cases where a single sales order represents
multiple customer orders.

**Table of contents**

.. contents::
:local:

Configuration
=============

To display the Customer Order Reference on sale reports:

- Go to *Sales → Configuration → Settings*.
- Enable **Show Customer Order Reference in Sale Reports (PDF)**. If
selected, the Order Ref column will be added to the lines in the sale
report (PDF).

To display the Customer Order Reference on invoice reports:

- Go to *Invoicing / Accounting → Configuration → Settings*.
- Enable **Show Customer Order Reference in Invoice Reports (PDF)**. If
selected, the Order Ref column will be added to the lines in the
invoice report (PDF).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_line_client_order_ref%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Quartile

Contributors
------------

- Quartile <https://www.quartile.co>

- Yoshi Tashiro
- Aung Ko Ko Lin

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px
:target: https://github.com/yostashiro
:alt: yostashiro
.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px
:target: https://github.com/aungkokolin1997
:alt: aungkokolin1997

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-yostashiro| |maintainer-aungkokolin1997|

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_order_line_client_order_ref>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions sale_order_line_client_order_ref/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions sale_order_line_client_order_ref/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale Order Line Cient Order Reference",
"version": "18.0.1.0.0",
"author": "Quartile, Odoo Community Association (OCA)",
"category": "Sale",
"website": "https://github.com/OCA/sale-workflow",
"license": "AGPL-3",
"depends": ["sale"],
"data": [
"views/account_move_views.xml",
"views/res_config_settings_views.xml",
"views/sale_order_views.xml",
"reports/report_invoice_document.xml",
"reports/report_saleorder_document.xml",
],
"maintainers": ["yostashiro", "aungkokolin1997"],
"installable": True,
}
32 changes: 32 additions & 0 deletions sale_order_line_client_order_ref/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_line_client_order_ref
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-02 03:30+0000\n"
"PO-Revision-Date: 2025-12-02 03:30+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_order_line_client_order_ref
#: model:ir.model.fields,field_description:sale_order_line_client_order_ref.field_account_move_line__client_order_ref
#: model:ir.model.fields,field_description:sale_order_line_client_order_ref.field_sale_order_line__client_order_ref
msgid "Customer Order Ref"
msgstr "顧客発注番号"

#. module: sale_order_line_client_order_ref
#: model:ir.model,name:sale_order_line_client_order_ref.model_account_move_line
msgid "Journal Item"
msgstr "仕訳明細"

#. module: sale_order_line_client_order_ref
#: model:ir.model,name:sale_order_line_client_order_ref.model_sale_order_line
msgid "Sales Order Line"
msgstr "販売オーダ明細"
4 changes: 4 additions & 0 deletions sale_order_line_client_order_ref/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import account_move_line
from . import res_company
from . import res_config_settings
from . import sale_order_line
10 changes: 10 additions & 0 deletions sale_order_line_client_order_ref/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2025 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class AccountMoveLine(models.Model):
_inherit = "account.move.line"

client_order_ref = fields.Char("Customer Order Ref")
11 changes: 11 additions & 0 deletions sale_order_line_client_order_ref/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2025 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

show_client_order_ref_sale = fields.Boolean()
show_client_order_ref_invoice = fields.Boolean()
15 changes: 15 additions & 0 deletions sale_order_line_client_order_ref/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

show_client_order_ref_sale = fields.Boolean(
related="company_id.show_client_order_ref_sale", readonly=False
)
show_client_order_ref_invoice = fields.Boolean(
related="company_id.show_client_order_ref_invoice", readonly=False
)
25 changes: 25 additions & 0 deletions sale_order_line_client_order_ref/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2025 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

client_order_ref = fields.Char(
"Customer Order Ref",
compute="_compute_client_order_ref",
store=True,
readonly=False,
)

@api.depends("order_id.client_order_ref")
def _compute_client_order_ref(self):
for rec in self:
rec.client_order_ref = rec.order_id.client_order_ref

def _prepare_invoice_line(self, **optional_values):
res = super()._prepare_invoice_line(**optional_values)
res["client_order_ref"] = self.client_order_ref
return res
3 changes: 3 additions & 0 deletions sale_order_line_client_order_ref/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
11 changes: 11 additions & 0 deletions sale_order_line_client_order_ref/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To display the Customer Order Reference on sale reports:

- Go to *Sales → Configuration → Settings*.
- Enable **Show Customer Order Reference in Sale Reports (PDF)**. If selected, the Order
Ref column will be added to the lines in the sale report (PDF).

To display the Customer Order Reference on invoice reports:

- Go to *Invoicing / Accounting → Configuration → Settings*.
- Enable **Show Customer Order Reference in Invoice Reports (PDF)**. If selected, the Order
Ref column will be added to the lines in the invoice report (PDF).
3 changes: 3 additions & 0 deletions sale_order_line_client_order_ref/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Quartile \<<https://www.quartile.co>\>
- Yoshi Tashiro
- Aung Ko Ko Lin
9 changes: 9 additions & 0 deletions sale_order_line_client_order_ref/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This module provides the following features:

- Adds a Customer Order Number to sale order lines and propagates the value to
invoice lines.
- Allows the Customer Order Number to be displayed in both sale and invoice
reports.

This module is useful in cases where a single sales order represents multiple
customer orders.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<odoo>
<template
id="report_invoice_document_inherit"
inherit_id="account.report_invoice_document"
>
<xpath expr="//th[@name='th_description']" position="after">
<th
name="th_client_order_ref"
t-if="o.company_id.show_client_order_ref_invoice and o.move_type in ['out_invoice', 'out_refund', 'out_receipt']"
class="text-start"
>Order Ref</th>
</xpath>
<xpath expr="//td[@name='account_invoice_line_name']" position="after">
<td
name="td_client_order_ref"
t-if="o.company_id.show_client_order_ref_invoice and o.move_type in ['out_invoice', 'out_refund', 'out_receipt']"
class="text-start"
>
<span t-esc="line.client_order_ref" />
</td>
</xpath>
</template>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<odoo>
<template
id="report_saleorder_document_inherit"
inherit_id="sale.report_saleorder_document"
>
<xpath expr="//th[@name='th_description']" position="after">
<th
name="th_client_order_ref"
t-if="doc.company_id.show_client_order_ref_sale"
class="text-start"
>Order Ref</th>
</xpath>
<xpath expr="//td[@name='td_name']" position="after">
<td
name="td_client_order_ref"
t-if="doc.company_id.show_client_order_ref_sale"
class="text-start"
>
<span t-esc="line.client_order_ref" />
</td>
</xpath>
</template>
</odoo>
Loading