Skip to content

Commit b49f7b3

Browse files
committed
[T-8373][IMP] partner_contact_show_ref: add option to show own ref instead of the parent one
1 parent e062db7 commit b49f7b3

9 files changed

Lines changed: 523 additions & 58 deletions

File tree

Lines changed: 45 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,77 @@
1-
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
2-
:target: http://www.gnu.org/licenses/agpl
3-
:alt: License: AGPL-3
4-
51
========================
62
Partner Contact Show Ref
73
========================
84

9-
Show the contact reference in the contact name
10-
11-
12-
Installation
13-
============
14-
15-
To install this module, you need to:
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:b83a812524400026c54c941e7834574fe52ef6e87ad63767d43603519d7bc3ce
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-sygel--technology%2Fsy--partner--contact-lightgray.png?logo=github
20+
:target: https://github.com/sygel-technology/sy-partner-contact/tree/17.0/partner_contact_show_ref
21+
:alt: sygel-technology/sy-partner-contact
22+
23+
|badge1| |badge2| |badge3|
1624

17-
#. Only install
18-
19-
20-
Configuration
21-
=============
22-
23-
To configure this module, you need to:
25+
Show the contact reference in the contact name
2426

25-
#. Only install
27+
**Table of contents**
2628

29+
.. contents::
30+
:local:
2731

2832
Usage
2933
=====
3034

3135
To use this module, you need to:
3236

33-
#. Go to a partner form of type company
34-
#. In the "Sales and Purchase" tab, fill the "Reference" field.
35-
#. The partner name will show the reference. The reference will also be shown in all of the partner childrens
36-
37-
38-
ROADMAP
39-
=======
40-
41-
[ Enumerate known caveats and future potential improvements.
42-
It is mostly intended for end-users, and can also help
43-
potential new contributors discovering new features to implement. ]
44-
45-
* ...
46-
37+
#. Go to a partner form of type company #. In the "Sales and Purchase"
38+
tab, fill the "Reference" field. #. The partner name will show the
39+
reference. The reference will also be shown in all of the partner
40+
childrens #. If you want to show, in a children partner, its own
41+
reference instead of the parent reference, go to the children form, and
42+
mark the "Own ref in name" checkbox, located under the "Reference"
43+
field.
4744

4845
Bug Tracker
4946
===========
5047

51-
Bugs and errors are managed in `issues of GitHub <https://github.com/sygel-technology/REPOSITORY/issues>`_.
52-
In case of problems, please check if your problem has already been
53-
reported. If you are the first to discover it, help us solving it by indicating
54-
a detailed description `here <https://github.com/sygel-technology/REPOSITORY/issues/new>`_.
48+
Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-partner-contact/issues>`_.
49+
In case of trouble, please check there if your issue has already been reported.
50+
If you spotted it first, help us to smash it by providing a detailed and welcomed
51+
`feedback <https://github.com/sygel-technology/sy-partner-contact/issues/new?body=module:%20partner_contact_show_ref%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5552

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

58-
5955
Credits
6056
=======
6157

6258
Authors
63-
~~~~~~~
64-
65-
* Sygel, Odoo Community Association (OCA)
59+
-------
6660

61+
* Sygel
6762

6863
Contributors
69-
~~~~~~~~~~~~
70-
71-
* Valentin Vinagre <valentin.vinagre@sygel.es>
72-
* Alberto Martínez <alberto.martinez@sygel.es>
73-
74-
75-
Maintainer
76-
~~~~~~~~~~
64+
------------
7765

78-
This module is maintained by Sygel.
66+
- `Sygel <https://www.sygel.es>`__:
7967

80-
.. image:: https://www.sygel.es/logo.png
81-
:alt: Sygel
82-
:target: https://www.sygel.es
68+
- Alberto Martínez
69+
- Valentin Vinagre
70+
- Harald Panten
8371

84-
This module is part of the `Sygel/REPOSITORY <https://github.com/sygel-technology/REPOSITORY>`_.
72+
Maintainers
73+
-----------
8574

86-
To contribute to this module, please visit https://github.com/sygel-technology/.
75+
This module is part of the `sygel-technology/sy-partner-contact <https://github.com/sygel-technology/sy-partner-contact/tree/17.0/partner_contact_show_ref>`_ project on GitHub.
8776

77+
You are welcome to contribute.

partner_contact_show_ref/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
"depends": [
1414
"base",
1515
],
16+
"data": ["views/res_partner_views.xml"],
1617
}
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Copyright 2025 Alberto Martínez <alberto.martinez@sygel.es>
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

4-
from odoo import models
4+
from odoo import fields, models
55

66

77
class Partner(models.Model):
88
_inherit = "res.partner"
99

10+
own_ref_in_name = fields.Boolean()
11+
1012
def _get_complete_name(self):
1113
name = super()._get_complete_name()
12-
if self.commercial_partner_id.ref:
13-
name = f"[{self.commercial_partner_id.ref}] {name}"
14+
ref = self.ref if self.own_ref_in_name else self.commercial_partner_id.ref
15+
if ref:
16+
name = f"[{ref}] {name}"
1417
return name
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- [Sygel](https://www.sygel.es):
2+
- Alberto Martínez
3+
- Valentin Vinagre
4+
- Harald Panten
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Show the contact reference in the contact name
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
To use this module, you need to:
2+
3+
#. Go to a partner form of type company
4+
#. In the "Sales and Purchase" tab, fill the "Reference" field.
5+
#. The partner name will show the reference. The reference will also be shown in all of the partner childrens
6+
#. If you want to show, in a children partner, its own reference instead of the parent reference, go to the children form, and mark the "Own ref
7+
in name" checkbox, located under the "Reference" field.

0 commit comments

Comments
 (0)