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
56 changes: 56 additions & 0 deletions partner_end_customer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
====================
Partner End Customer
====================

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

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Fhls--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/hls-custom/tree/18.0/partner_end_customer
:alt: qrtl/hls-custom

|badge1| |badge2| |badge3|

This module adds an end customer field to partners, shown and searchable
on sale orders and customer invoices.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/hls-custom/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/qrtl/hls-custom/issues/new?body=module:%20partner_end_customer%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

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

This module is part of the `qrtl/hls-custom <https://github.com/qrtl/hls-custom/tree/18.0/partner_end_customer>`_ project on GitHub.

You are welcome to contribute.
2 changes: 2 additions & 0 deletions partner_end_customer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import pre_init_hook
19 changes: 19 additions & 0 deletions partner_end_customer/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
{
"name": "Partner End Customer",
"summary": "Add an end customer field to partners, searchable on sale orders",
"version": "18.0.1.0.0",
"category": "Sales",
"website": "https://www.quartile.co",
"author": "Quartile",
"license": "LGPL-3",
"installable": True,
"depends": ["sale"],
"pre_init_hook": "pre_init_hook",
"data": [
"views/account_move_views.xml",
"views/res_partner_views.xml",
"views/sale_order_views.xml",
],
}
10 changes: 10 additions & 0 deletions partner_end_customer/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo.tools.sql import column_exists


def pre_init_hook(env):
for table in ("sale_order", "account_move"):
if not column_exists(env.cr, table, "end_customer"):
env.cr.execute(f"ALTER TABLE {table} ADD COLUMN end_customer VARCHAR")
48 changes: 48 additions & 0 deletions partner_end_customer/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_end_customer
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-03 08:39+0000\n"
"PO-Revision-Date: 2026-09-03 08:39+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: partner_end_customer
#: model:ir.model,name:partner_end_customer.model_res_partner
msgid "Contact"
msgstr "連絡先"

#. module: partner_end_customer
#: model:ir.model.fields,help:partner_end_customer.field_res_partner__end_customer
#: model:ir.model.fields,help:partner_end_customer.field_res_users__end_customer
msgid ""
"E.g. the customer beyond a trading company or wholesaler, such as a "
"restaurant or supermarket."
msgstr "例:商社・卸の先にいる顧客(外食・スーパーなど)。"

#. module: partner_end_customer
#: model:ir.model.fields,field_description:partner_end_customer.field_account_bank_statement_line__end_customer
#: model:ir.model.fields,field_description:partner_end_customer.field_account_move__end_customer
#: model:ir.model.fields,field_description:partner_end_customer.field_res_partner__end_customer
#: model:ir.model.fields,field_description:partner_end_customer.field_res_users__end_customer
#: model:ir.model.fields,field_description:partner_end_customer.field_sale_order__end_customer
msgid "End Customer"
msgstr "最終顧客"

#. module: partner_end_customer
#: model:ir.model,name:partner_end_customer.model_account_move
msgid "Journal Entry"
msgstr "仕訳"

#. module: partner_end_customer
#: model:ir.model,name:partner_end_customer.model_sale_order
msgid "Sales Order"
msgstr "販売オーダ"
3 changes: 3 additions & 0 deletions partner_end_customer/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import account_move
from . import res_partner
from . import sale_order
24 changes: 24 additions & 0 deletions partner_end_customer/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo import api, fields, models


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

end_customer = fields.Char(
compute="_compute_end_customer",
store=True,
readonly=False,
tracking=True,
)
Comment thread
smorita7749 marked this conversation as resolved.

@api.depends("move_type", "partner_shipping_id")
def _compute_end_customer(self):
for move in self:
move.end_customer = (
move.partner_shipping_id.end_customer
if move.is_sale_document()
else False
)
13 changes: 13 additions & 0 deletions partner_end_customer/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

end_customer = fields.Char(
help="E.g. the customer beyond a trading company or wholesaler, such "
"as a restaurant or supermarket."
)
25 changes: 25 additions & 0 deletions partner_end_customer/models/sale_order.py
Comment thread
smorita7749 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo import api, fields, models


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

end_customer = fields.Char(
compute="_compute_end_customer",
store=True,
readonly=False,
tracking=True,
)

@api.depends("partner_shipping_id")
def _compute_end_customer(self):
for order in self:
order.end_customer = order.partner_shipping_id.end_customer

def _prepare_invoice(self):
values = super()._prepare_invoice()
values["end_customer"] = self.end_customer
return values
3 changes: 3 additions & 0 deletions partner_end_customer/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions partner_end_customer/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds an end customer field to partners, shown and searchable on sale
orders and customer invoices.
Loading
Loading