Skip to content

Commit f5cd1cb

Browse files
committed
[ADD] sale_order_client_order_ref_mandatory
For a Sale Order, makes required client_order_ref field and reposition it,for both form view and Sale reports. Also makes this field searchable and add an optional column on both quotation and sale orders lists.
1 parent 6f5cb9b commit f5cd1cb

16 files changed

+729
-0
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
=====================================
2+
Sale Order Client Order Ref Mandatory
3+
=====================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:7958cbf2a8aa393f6b649de571594b362d2043e10285117f485b8cfa5a33e49f
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
20+
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_order_client_order_ref_mandatory
21+
:alt: OCA/sale-workflow
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_order_client_order_ref_mandatory
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
For a Sale Order, makes required client_order_ref field and reposition
32+
it, for both form view and Sale reports. Also makes this field
33+
searchable and add an optional column on both quotation and sale orders
34+
lists
35+
36+
Sale Order Form View
37+
--------------------
38+
39+
Before
40+
~~~~~~
41+
42+
|sale_order_before|
43+
44+
After
45+
~~~~~
46+
47+
|sale_order_after|
48+
49+
Sale Report
50+
-----------
51+
52+
Before
53+
~~~~~~
54+
55+
|template_before|
56+
57+
After
58+
~~~~~
59+
60+
|template_after|
61+
62+
.. |sale_order_before| image:: https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_order_client_order_ref_mandatory/static/description/client_sale_order_ref_before_image.png
63+
.. |sale_order_after| image:: https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_order_client_order_ref_mandatory/static/description/client_sale_order_ref_after_image.png
64+
.. |template_before| image:: https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_order_client_order_ref_mandatory/static/description/client_sale_order_ref_template_before_image.png
65+
.. |template_after| image:: https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_order_client_order_ref_mandatory/static/description/client_sale_order_ref_template_after_image.png
66+
67+
**Table of contents**
68+
69+
.. contents::
70+
:local:
71+
72+
Bug Tracker
73+
===========
74+
75+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
76+
In case of trouble, please check there if your issue has already been reported.
77+
If you spotted it first, help us to smash it by providing a detailed and welcomed
78+
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_client_order_ref_mandatory%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
79+
80+
Do not contact contributors directly about support or help with technical issues.
81+
82+
Credits
83+
=======
84+
85+
Authors
86+
-------
87+
88+
* Solvos
89+
90+
Contributors
91+
------------
92+
93+
- `Solvos <https://www.solvos.es>`__
94+
95+
- Christian Santamaría <christian.santamaria@solvos.es>
96+
- David Alonso <david.alonso@solvos.es>
97+
- Dante Pereyra <dante.pereyra@solvos.es>
98+
99+
Maintainers
100+
-----------
101+
102+
This module is maintained by the OCA.
103+
104+
.. image:: https://odoo-community.org/logo.png
105+
:alt: Odoo Community Association
106+
:target: https://odoo-community.org
107+
108+
OCA, or the Odoo Community Association, is a nonprofit organization whose
109+
mission is to support the collaborative development of Odoo features and
110+
promote its widespread use.
111+
112+
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_order_client_order_ref_mandatory>`_ project on GitHub.
113+
114+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# © 2025 Solvos Consultoría Informática (<http://www.solvos.es>)
2+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
3+
{
4+
"name": "Sale Order Client Order Ref Mandatory",
5+
"summary": """
6+
Adds required client_order_ref field and reposition it
7+
""",
8+
"author": "Solvos, Odoo Community Association (OCA)",
9+
"license": "AGPL-3",
10+
"version": "18.0.1.0.0",
11+
"category": "Sale",
12+
"website": "https://github.com/OCA/sale-workflow",
13+
"depends": ["sale"],
14+
"data": [
15+
"views/sale_order_view.xml",
16+
"report/sale_order_report_templates.xml",
17+
],
18+
"installable": True,
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sale_order_client_order_ref_mandatory
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-07-02 07:08+0000\n"
10+
"PO-Revision-Date: 2025-07-02 07:08+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: sale_order_client_order_ref_mandatory
19+
#: model_terms:ir.ui.view,arch_db:sale_order_client_order_ref_mandatory.view_order_form
20+
msgid "Enter the customer reference here"
21+
msgstr "Introduzca aquí la referencia del cliente"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import sale_order
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# © 2025 Solvos Consultoría Informática (<http://www.solvos.es>)
2+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
3+
from odoo import fields, models
4+
5+
6+
class SaleOrder(models.Model):
7+
_inherit = "sale.order"
8+
9+
client_order_ref = fields.Char(
10+
string="Customer Reference",
11+
copy=False,
12+
default=lambda self: self._default_test_dummy_name(),
13+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- [Solvos](https://www.solvos.es)
2+
- Christian Santamaría \<<christian.santamaria@solvos.es>\>
3+
- David Alonso \<<david.alonso@solvos.es>\>
4+
- Dante Pereyra \<<dante.pereyra@solvos.es>\>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
For a Sale Order, makes required client_order_ref field and reposition it,
2+
for both form view and Sale reports.
3+
Also makes this field searchable and add an optional column on both quotation and sale orders lists
4+
5+
## Sale Order Form View
6+
### Before
7+
![sale_order_before](../static/description/client_sale_order_ref_before_image.png)
8+
### After
9+
![sale_order_after](../static/description/client_sale_order_ref_after_image.png)
10+
11+
## Sale Report
12+
### Before
13+
![template_before](../static/description/client_sale_order_ref_template_before_image.png)
14+
### After
15+
![template_after](../static/description/client_sale_order_ref_template_after_image.png)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<odoo>
2+
<template
3+
id="report_saleorder_document"
4+
inherit_id="sale.report_saleorder_document"
5+
>
6+
<xpath expr="//div[@id='informations']" position="before">
7+
<h3>
8+
<span t-field="doc.client_order_ref" />
9+
</h3>
10+
</xpath>
11+
<xpath
12+
expr="//div[@t-field='doc.client_order_ref']/parent::div"
13+
position="attributes"
14+
>
15+
<attribute name="t-if">False</attribute>
16+
</xpath>
17+
</template>
18+
</odoo>

0 commit comments

Comments
 (0)