Skip to content

Commit 6166616

Browse files
ajaniszewska-devgrindtildeath
authored andcommitted
[12.0][ADD] Add purchase_requisition_line_description module
1 parent 0890671 commit 6166616

15 files changed

Lines changed: 655 additions & 0 deletions
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
=====================================
2+
Purchase Requisition Line Description
3+
=====================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:405e85e08275d1587968af96708a04713716fa80f749677afa963c43080c9131
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%2Fpurchase--workflow-lightgray.png?logo=github
20+
:target: https://github.com/OCA/purchase-workflow/tree/12.0/purchase_requisition_line_description
21+
:alt: OCA/purchase-workflow
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_requisition_line_description
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/purchase-workflow&target_branch=12.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows to use product purchase description on the purchase requisition lines.
32+
33+
**Table of contents**
34+
35+
.. contents::
36+
:local:
37+
38+
Usage
39+
=====
40+
41+
1. Add or modify a purchase description to any of your products.
42+
2. Create a purchase agreement and add a purchase requisition line with this product and check out that now purchase requisition line description contains the description.
43+
44+
Bug Tracker
45+
===========
46+
47+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
48+
In case of trouble, please check there if your issue has already been reported.
49+
If you spotted it first, help us to smash it by providing a detailed and welcomed
50+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_requisition_line_description%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
51+
52+
Do not contact contributors directly about support or help with technical issues.
53+
54+
Credits
55+
=======
56+
57+
Authors
58+
~~~~~~~
59+
60+
* Camptocamp
61+
62+
Contributors
63+
~~~~~~~~~~~~
64+
65+
* Anna Janiszewska <anna.janiszewska@camptocamp.com>
66+
67+
Maintainers
68+
~~~~~~~~~~~
69+
70+
This module is maintained by the OCA.
71+
72+
.. image:: https://odoo-community.org/logo.png
73+
:alt: Odoo Community Association
74+
:target: https://odoo-community.org
75+
76+
OCA, or the Odoo Community Association, is a nonprofit organization whose
77+
mission is to support the collaborative development of Odoo features and
78+
promote its widespread use.
79+
80+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/12.0/purchase_requisition_line_description>`_ project on GitHub.
81+
82+
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2021 Camptocamp
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
'name': 'Purchase Requisition Line Description',
6+
'summary': 'Extends the functionality of Purchase Agreements to '
7+
'show line description.',
8+
'version': '12.0.1.0.0',
9+
'category': 'Purchases',
10+
'website': 'https://github.com/OCA/purchase-workflow',
11+
'author': 'Camptocamp, Odoo Community Association (OCA)',
12+
'license': 'AGPL-3',
13+
'application': False,
14+
'installable': True,
15+
'depends': [
16+
'purchase_requisition',
17+
],
18+
'data': [
19+
'views/purchase_requisition.xml',
20+
'report/purchase_requisition_report.xml',
21+
],
22+
}
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+
# * purchase_requisition_line_description
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 12.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: <>\n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: purchase_requisition_line_description
17+
#: model_terms:ir.ui.view,arch_db:purchase_requisition_line_description.purchase_requisition
18+
msgid "<strong>Description</strong>"
19+
msgstr ""
20+
21+
#. module: purchase_requisition_line_description
22+
#: model_terms:ir.ui.view,arch_db:purchase_requisition_line_description.purchase_requisition
23+
msgid "<strong>Product</strong>"
24+
msgstr ""
25+
26+
#. module: purchase_requisition_line_description
27+
#: model:ir.model.fields,field_description:purchase_requisition_line_description.field_purchase_requisition_line__name
28+
msgid "Description"
29+
msgstr ""
30+
31+
#. module: purchase_requisition_line_description
32+
#: model:ir.model,name:purchase_requisition_line_description.model_purchase_requisition_line
33+
msgid "Purchase Requisition Line"
34+
msgstr ""
35+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import purchase_requisition_line
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2021 Camptocamp SA
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
from odoo import api, fields, models
5+
from odoo.fields import first
6+
7+
8+
class PurchaseRequisitionLine(models.Model):
9+
_inherit = "purchase.requisition.line"
10+
11+
name = fields.Text(string="Description")
12+
13+
@api.onchange('product_id')
14+
def _onchange_product_id(self):
15+
res = super()._onchange_product_id()
16+
if self.product_id:
17+
18+
partner = (
19+
self.requisition_id.purchase_ids.partner_id
20+
or first(self.requisition_id.mapped("purchase_ids")).partner_id
21+
)
22+
product_lang = self.product_id.with_context(
23+
lang=partner.lang, partner_id=partner.id,
24+
)
25+
self.name = product_lang.display_name
26+
if product_lang.description_purchase:
27+
self.name += '\n' + product_lang.description_purchase
28+
return res
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Anna Janiszewska <anna.janiszewska@camptocamp.com>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module allows to use product purchase description on the purchase requisition lines.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1. Add or modify a purchase description to any of your products.
2+
2. Create a purchase agreement and add a purchase requisition line with this product and check out that now purchase requisition line description contains the description.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<odoo>
2+
<template id="purchase_requisition" name="Purchase Requisition" inherit_id="purchase_requisition.report_purchaserequisitions">
3+
<xpath expr="//t[@t-if='o.line_ids']/table//th[1]" position="replace">
4+
<th><strong>Product</strong></th>
5+
<th><strong>Description</strong></th>
6+
</xpath>
7+
<xpath expr="//t[@t-if='o.line_ids']/table//td[1]" position="after">
8+
<td><span t-field="line_ids.name"/></td>
9+
</xpath>
10+
</template>
11+
</odoo>

0 commit comments

Comments
 (0)