Skip to content
Closed
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
98 changes: 98 additions & 0 deletions purchase_order_line_desc_wo_product_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
====================================================
Purchase Order Line Description Without Product Code
====================================================

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

.. |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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_order_line_desc_wo_product_code
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_order_line_desc_wo_product_code
: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/purchase-workflow&target_branch=18.0
:alt: Try me on Runboat

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

Avoid duplicated product codes in purchase order line descriptions.

By default, Odoo automatically prepends the Internal Reference to the
product name when adding a product to a Purchase Order (e.g.,
"[FURN_6666] Acoustic Bloc Screens").

This module modifies that behavior by passing
"display_default_code=False" to the context.

**Table of contents**

.. contents::
:local:

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

1. Go to Purchase > Configuration > Settings.
2. Check the Hide Product Code option.

Usage
=====

1. Go to Purchase > Orders > Requests for Quotation (or Purchase
Orders).
2. Add a product that has an internal reference to the order lines.
3. The product description will automatically be inserted without the
internal reference code.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-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/purchase-workflow/issues/new?body=module:%20purchase_order_line_desc_wo_product_code%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
-------

* Solvos

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

- Carlos García <carlos.garcia@solvos.es>

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.

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_order_line_desc_wo_product_code>`_ 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 purchase_order_line_desc_wo_product_code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions purchase_order_line_desc_wo_product_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# © 2026 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Order Line Description Without Product Code",
"summary": """
Avoid duplicated product codes in purchase order line descriptions
""",
"author": "Solvos," "Odoo Community Association (OCA)",
"license": "AGPL-3",
"version": "18.0.1.0.0",
"category": "Purchase",
"website": "https://github.com/OCA/purchase-workflow",
"depends": [
"purchase",
],
"data": [
"views/res_config_settings.xml",
],
"installable": True,
}
3 changes: 3 additions & 0 deletions purchase_order_line_desc_wo_product_code/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import purchase_oder_line
from . import res_company
from . import res_config_settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# © 2026 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import models


class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"

def _get_product_purchase_description(self, product_lang):
self.ensure_one()

product_lang = product_lang.with_context(
display_default_code=not self.env.company.hide_product_code
)

return super()._get_product_purchase_description(product_lang)
10 changes: 10 additions & 0 deletions purchase_order_line_desc_wo_product_code/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# © 2026 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import fields, models


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

hide_product_code = fields.Boolean(default=False)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# © 2026 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import fields, models


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

hide_product_code = fields.Boolean(
related="company_id.hide_product_code", readonly=False
)
3 changes: 3 additions & 0 deletions purchase_order_line_desc_wo_product_code/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 purchase_order_line_desc_wo_product_code/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Go to Purchase > Configuration > Settings.
2. Check the Hide Product Code option.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Carlos García \<carlos.garcia@solvos.es\>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Avoid duplicated product codes in purchase order line descriptions.

By default, Odoo automatically prepends the Internal Reference to the product name when adding a product to a Purchase Order (e.g., "[FURN_6666] Acoustic Bloc Screens").

This module modifies that behavior by passing "display_default_code=False" to the context.
3 changes: 3 additions & 0 deletions purchase_order_line_desc_wo_product_code/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. Go to Purchase > Orders > Requests for Quotation (or Purchase Orders).
2. Add a product that has an internal reference to the order lines.
3. The product description will automatically be inserted without the internal reference code.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading