Skip to content

Commit 59130ab

Browse files
committed
[T-8592][MIG] partner_code_program_sale: migration to 18.0
1 parent 8a6b4dc commit 59130ab

9 files changed

Lines changed: 98 additions & 36 deletions

File tree

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
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
=========================
6-
Partner code program Sale
2+
Partner Code Program Sale
73
=========================
84

9-
This module adds the partner code program in sale orders and sale reports
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:07ed2493cc1b25c3fdf50d649dcc786a17574db54a168d4a0a218017ab134257
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1012
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/18.0/partner_code_program_sale
21+
:alt: sygel-technology/sy-partner-contact
1122

12-
Usage
13-
=====
23+
|badge1| |badge2| |badge3|
1424

15-
To use this module, you need to:
25+
This module adds the partner code program in sale orders and sale
26+
reports
1627

17-
#. Create new program codes in Contacts / Configuration / Code Programs
18-
#. Edit the code program of a partner of type company in the address field of the partner form
19-
#. Create a sales order with that partner. Now you can filter and group by code program
28+
**Table of contents**
2029

30+
.. contents::
31+
:local:
2132

2233
Installation
2334
============
@@ -26,52 +37,52 @@ To install this module, you need to:
2637

2738
#. Only install
2839

29-
3040
Configuration
3141
=============
3242

3343
To configure this module, you need to:
3444

3545
#. Only install
3646

47+
Usage
48+
=====
49+
50+
To use this module, you need to:
51+
52+
#. Create new program codes in Contacts / Configuration / Code Programs
53+
#. Edit the code program of a partner of type company in the address
54+
field of the partner form #. Create a sales order with that partner. Now
55+
you can filter and group by code program
3756

3857
Bug Tracker
3958
===========
4059

41-
Bugs and errors are managed in `issues of GitHub <https://github.com/sygel-technology/sy-partner-contact/issues>`_.
42-
In case of problems, please check if your problem has already been
43-
reported. If you are the first to discover it, help us solving it by indicating
44-
a detailed description `here <https://github.com/sygel-technology/sy-partner-contact/issues/new>`_.
60+
Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-partner-contact/issues>`_.
61+
In case of trouble, please check there if your issue has already been reported.
62+
If you spotted it first, help us to smash it by providing a detailed and welcomed
63+
`feedback <https://github.com/sygel-technology/sy-partner-contact/issues/new?body=module:%20partner_code_program_sale%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
4564

4665
Do not contact contributors directly about support or help with technical issues.
4766

48-
4967
Credits
5068
=======
5169

5270
Authors
53-
~~~~~~~
54-
55-
* Sygel, Odoo Community Association (OCA)
71+
-------
5672

73+
* Sygel
5774

5875
Contributors
59-
~~~~~~~~~~~~
60-
61-
* Valentin Vinagre <valentin.vinagre@sygel.es>
62-
* Alberto Martínez <alberto.martinez@sygel.es>
63-
64-
65-
Maintainer
66-
~~~~~~~~~~
76+
------------
6777

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

70-
.. image:: https://www.sygel.es/logo.png
71-
:alt: Sygel
72-
:target: https://www.sygel.es
80+
- Valentín Vinagre
81+
- Alberto Martínez
7382

74-
This module is part of the `Sygel/sy-partner-contact <https://github.com/sygel-technology/sy-partner-contact>`_.
83+
Maintainers
84+
-----------
7585

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

88+
You are welcome to contribute.

partner_code_program_sale/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Partner Code Program Sale",
55
"summary": "Adds the partner code program fields on sales",
6-
"version": "17.0.1.0.0",
6+
"version": "18.0.1.0.0",
77
"category": "Partner Management",
88
"website": "https://github.com/sygel-technology/sy-partner-contact",
99
"author": "Sygel",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To configure this module, you need to:
2+
3+
#. Only install
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [Sygel](https://www.sygel.es):
2+
- Valentín Vinagre
3+
- Alberto Martínez
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module adds the partner code program in sale orders and sale reports
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To install this module, you need to:
2+
3+
#. Only install
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
To use this module, you need to:
2+
3+
#. Create new program codes in Contacts / Configuration / Code Programs
4+
#. Edit the code program of a partner of type company in the address field of the partner form
5+
#. Create a sales order with that partner. Now you can filter and group by code program
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import test_partner_code_program_sale
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from odoo.tests.common import TransactionCase
2+
3+
4+
class TestPartnerCodeProgramSale(TransactionCase):
5+
@classmethod
6+
def setUpClass(cls):
7+
super().setUpClass()
8+
9+
cls.partner_code_program = cls.env["res.partner.code.program"].create(
10+
{
11+
"name": "Program test",
12+
"code": "CP-001",
13+
}
14+
)
15+
16+
cls.partner = cls.env["res.partner"].create(
17+
{
18+
"name": "Partner test",
19+
"code_program_id": cls.partner_code_program.id,
20+
}
21+
)
22+
23+
cls.sale_report = cls.env["sale.report"]
24+
25+
def test_code_program_id(self):
26+
self.assertIn("code_program_id", self.sale_report._fields)
27+
28+
def test_code_program_id_in_select_additional_fields(self):
29+
fields = self.env["sale.report"]._select_additional_fields()
30+
self.assertIn("code_program_id", fields)
31+
self.assertEqual(fields["code_program_id"], "partner.code_program_id")
32+
33+
def test_code_program_id_in_group_by(self):
34+
group_by = self.env["sale.report"]._group_by_sale()
35+
self.assertIn("partner.code_program_id", group_by)

0 commit comments

Comments
 (0)