Skip to content

Commit a001562

Browse files
committed
Merge PR #54 into 18.0
Signed-off-by ValentinVinagre
2 parents 630811e + cc12887 commit a001562

19 files changed

Lines changed: 783 additions & 0 deletions
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
=======================================
2+
Partner Code Program Territory Purchase
3+
=======================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:fba1cde7cd9f3f7cfa00fa7ad1e67ddbc06ebd0f1fa4fc6995ed31955e2cb66f
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/18.0/partner_code_program_territory_purchase
21+
:alt: sygel-technology/sy-partner-contact
22+
23+
|badge1| |badge2| |badge3|
24+
25+
This module adds the partner code program territory in purchase orders
26+
and purchase reports
27+
28+
**Table of contents**
29+
30+
.. contents::
31+
:local:
32+
33+
Installation
34+
============
35+
36+
To install this module, you need to:
37+
38+
- Only install
39+
40+
Configuration
41+
=============
42+
43+
To configure this module, you need to:
44+
45+
- Only install
46+
47+
Usage
48+
=====
49+
50+
To use this module, you need to:
51+
52+
1. Create new program territory codes in *Contacts > Configuration >
53+
Code Programs*
54+
2. Edit the code program territory of a partner of type company in the
55+
address field of the partner form
56+
3. Create a purchase order with that partner. Now you can filter and
57+
group by code program territory
58+
59+
Bug Tracker
60+
===========
61+
62+
Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-partner-contact/issues>`_.
63+
In case of trouble, please check there if your issue has already been reported.
64+
If you spotted it first, help us to smash it by providing a detailed and welcomed
65+
`feedback <https://github.com/sygel-technology/sy-partner-contact/issues/new?body=module:%20partner_code_program_territory_purchase%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
66+
67+
Do not contact contributors directly about support or help with technical issues.
68+
69+
Credits
70+
=======
71+
72+
Authors
73+
-------
74+
75+
* Sygel
76+
77+
Contributors
78+
------------
79+
80+
- `Sygel <https://www.sygel.es>`__:
81+
82+
- Valentín Vinagre
83+
- Alberto Martínez
84+
85+
Maintainers
86+
-----------
87+
88+
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_territory_purchase>`_ project on GitHub.
89+
90+
You are welcome to contribute.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import models
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2024 Alberto Martínez <alberto.martinez@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Partner Code Program Territory Purchase",
5+
"summary": "Adds the partner code program territory fields on purchases",
6+
"version": "18.0.1.0.0",
7+
"category": "Partner Management",
8+
"website": "https://github.com/sygel-technology/sy-partner-contact",
9+
"author": "Sygel",
10+
"license": "AGPL-3",
11+
"application": False,
12+
"installable": True,
13+
"depends": ["partner_code_program_territory", "purchase"],
14+
"data": [
15+
"views/purchase_order.xml",
16+
"views/purchase_report.xml",
17+
],
18+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * partner_code_program_territory_purchase
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-06-07 11:16+0000\n"
10+
"PO-Revision-Date: 2024-06-07 11:16+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: partner_code_program_territory_purchase
19+
#: model:ir.model.fields,field_description:partner_code_program_territory_purchase.field_purchase_order__code_program_territory_id
20+
#: model:ir.model.fields,field_description:partner_code_program_territory_purchase.field_purchase_report__code_program_territory_id
21+
#: model_terms:ir.ui.view,arch_db:partner_code_program_territory_purchase.purchase_order_view_search_inherit_partner_code_program_territory
22+
#: model_terms:ir.ui.view,arch_db:partner_code_program_territory_purchase.view_purchase_order_filter_inherit_partner_code_program_territory
23+
#: model_terms:ir.ui.view,arch_db:partner_code_program_territory_purchase.view_purchase_order_search_inherit_partner_code_program_territory
24+
msgid "Code Program Territory"
25+
msgstr "Código de territorio"
26+
27+
#. module: partner_code_program_territory_purchase
28+
#: model:ir.model,name:partner_code_program_territory_purchase.model_purchase_order
29+
msgid "Purchase Order"
30+
msgstr "Pedido de compra"
31+
32+
#. module: partner_code_program_territory_purchase
33+
#: model:ir.model,name:partner_code_program_territory_purchase.model_purchase_report
34+
msgid "Purchase Report"
35+
msgstr "Informe de Compras"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import purchase_order
4+
from . import purchase_report
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2024 Alberto Martínez <alberto.martinez@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class PurchaseOrder(models.Model):
8+
_name = "purchase.order"
9+
_inherit = ["purchase.order", "res.partner.code.program.territory.mixin"]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2024 Alberto Martínez <alberto.martinez@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
from odoo.tools import SQL
6+
7+
8+
class PurchaseReport(models.Model):
9+
_inherit = "purchase.report"
10+
11+
code_program_territory_id = fields.Many2one(
12+
string="Code Program Territory",
13+
comodel_name="res.partner.code.program.territory",
14+
)
15+
16+
def _select(self):
17+
return SQL(
18+
"%s, partner.code_program_territory_id as code_program_territory_id",
19+
super()._select(),
20+
)
21+
22+
def _group_by(self):
23+
return SQL("%s, partner.code_program_territory_id", super()._group_by())
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: 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

0 commit comments

Comments
 (0)