-
Notifications
You must be signed in to change notification settings - Fork 9
[7122][ADD] partner_end_customer #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
67919a5
[7122][ADD] partner_final_customer
smorita7749 24e6816
[IMP] partner_final_customer: Add translations
smorita7749 7e8b81d
[IMP] partner_end_customer: rename from partner_final_customer, add p…
smorita7749 881f479
[IMP] partner_end_customer: use compute instead of related, add accou…
smorita7749 db41bcf
fixup!
smorita7749 60614bf
fixup!
smorita7749 520fa3a
fixup!
smorita7749 5caf570
fixup!
smorita7749 bf8f8f3
fixup!
smorita7749 4783875
fixup!
smorita7749 a5b19e9
fixup!
smorita7749 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| from . import models | ||
| from .hooks import pre_init_hook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| ], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 "販売オーダ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| ) | ||
|
|
||
| @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 | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." | ||
| ) |
|
smorita7749 marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.