Skip to content

Commit df48829

Browse files
matteonextyankinmax
authored andcommitted
[IMP]purchase_product_pack: migration to 18.0
1 parent 2a4cc84 commit df48829

File tree

7 files changed

+52
-40
lines changed

7 files changed

+52
-40
lines changed

purchase_product_pack/README.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
=====================
26
Purchase Product Pack
37
=====================
@@ -7,13 +11,13 @@ Purchase Product Pack
711
!! This file is generated by oca-gen-addon-readme !!
812
!! changes will be overwritten. !!
913
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:1c37bc5ae3753d96b784bb15fdbed5dcbe70cafb085cb3ddde5960c03d9c85a7
14+
!! source digest: sha256:c2dac7004783b8033eccca5252ad883ba2106fc36f774bb5680b539f372092be
1115
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1216
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github
@@ -78,9 +82,9 @@ Authors
7882
Contributors
7983
------------
8084

81-
- `Trobz <https://www.trobz.com>`__:
85+
- `Trobz <https://www.trobz.com>`__:
8286

83-
- Duong (Tran Quoc)
87+
- Duong (Tran Quoc)
8488

8589
Other credits
8690
-------------
@@ -89,7 +93,7 @@ Inspired by *sale_product_pack*
8993

9094
The development of this module has been financially supported by:
9195

92-
- Camptocamp
96+
- Camptocamp
9397

9498
Maintainers
9599
-----------

purchase_product_pack/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
33
{
44
"name": "Purchase Product Pack",
5-
"version": "16.0.1.0.0",
5+
"version": "18.0.1.0.0",
66
"category": "Purchase",
77
"summary": "This module allows you to buy product packs",
88
"website": "https://github.com/OCA/product-pack",

purchase_product_pack/i18n/purchase_product_pack.pot

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Odoo Server 16.0\n"
7+
"Project-Id-Version: Odoo Server 18.0\n"
88
"Report-Msgid-Bugs-To: \n"
99
"Last-Translator: \n"
1010
"Language-Team: \n"
@@ -78,7 +78,6 @@ msgstr ""
7878
#. module: purchase_product_pack
7979
#. odoo-python
8080
#: code:addons/purchase_product_pack/models/purchase_order_line.py:0
81-
#, python-format
8281
msgid "Parent Product"
8382
msgstr ""
8483

@@ -102,6 +101,11 @@ msgstr ""
102101
msgid "Purchase Order Line"
103102
msgstr ""
104103

104+
#. module: purchase_product_pack
105+
#: model:ir.model.fields,help:purchase_product_pack.field_purchase_order_line__do_no_expand_pack_lines
106+
msgid "Technical field in order to check if pack lines has to be expanded"
107+
msgstr ""
108+
105109
#. module: purchase_product_pack
106110
#: model:ir.model.fields,help:purchase_product_pack.field_purchase_order_line__pack_parent_line_id
107111
msgid "The pack that contains this product."
@@ -112,16 +116,9 @@ msgstr ""
112116
msgid "The parent pack is modifiable"
113117
msgstr ""
114118

115-
#. module: purchase_product_pack
116-
#: model:ir.model.fields,help:purchase_product_pack.field_purchase_order_line__do_no_expand_pack_lines
117-
msgid ""
118-
"This is a technical field in order to check if pack lines has to be expanded"
119-
msgstr ""
120-
121119
#. module: purchase_product_pack
122120
#. odoo-python
123121
#: code:addons/purchase_product_pack/models/purchase_order_line.py:0
124-
#, python-format
125122
msgid ""
126123
"You can not change this line because is part of a pack included in this "
127124
"order"
@@ -130,7 +127,6 @@ msgstr ""
130127
#. module: purchase_product_pack
131128
#. odoo-python
132129
#: code:addons/purchase_product_pack/models/purchase_order.py:0
133-
#, python-format
134130
msgid ""
135131
"You cannot delete this line because is part of a pack in this purchase "
136132
"order. In order to delete this line you need to delete the pack itself"

purchase_product_pack/models/purchase_order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def copy_data(self, default=None):
2525

2626
@api.onchange("order_line")
2727
def check_pack_line_unlink(self):
28-
# At least on embeded tree editable view odoo returns a recordset on
28+
# At least on embeded list editable view odoo returns a recordset on
2929
# origin.order_line only when lines are unlinked and this is exactly
3030
# what we need
3131
origin_line_ids = self._origin.order_line.ids

purchase_product_pack/models/purchase_order_line.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PurchaseOrderLine(models.Model):
3434

3535
do_no_expand_pack_lines = fields.Boolean(
3636
compute="_compute_do_no_expand_pack_lines",
37-
help="This is a technical field in order to check if pack lines has to be expanded",
37+
help="Technical field in order to check if pack lines has to be expanded",
3838
)
3939

4040
@api.depends_context("update_prices", "update_pricelist")
@@ -63,7 +63,8 @@ def expand_pack_line(self, write=False):
6363
if write:
6464
existing_subline = first(
6565
self.pack_child_line_ids.filtered(
66-
lambda child: child.product_id == subline.product_id
66+
lambda child, subline=subline: child.product_id
67+
== subline.product_id
6768
)
6869
)
6970
# if subline already exists we update, if not we create
@@ -128,7 +129,7 @@ def action_open_parent_pack_product_view(self):
128129
"type": "ir.actions.act_window",
129130
"res_model": "product.product",
130131
"view_type": "form",
131-
"view_mode": "tree,form",
132+
"view_mode": "list,form",
132133
"domain": domain,
133134
}
134135

@@ -157,10 +158,11 @@ def _compute_price_unit_and_date_planned_and_name(self):
157158
if not prices:
158159
continue
159160
cost = prices[line.product_id.id]
160-
# If not seller, use the standard price. It needs a proper currency conversion.
161+
# If not seller, use the standard price. It needs a proper
162+
# currency conversion.
161163
if not seller:
162164
unavailable_seller = line.product_id.seller_ids.filtered(
163-
lambda s: s.partner_id == line.order_id.partner_id
165+
lambda s, line=line: s.partner_id == line.order_id.partner_id
164166
)
165167
if (
166168
not unavailable_seller
@@ -169,7 +171,8 @@ def _compute_price_unit_and_date_planned_and_name(self):
169171
):
170172
# Avoid to modify the price unit if there is no price list
171173
# for this partner and
172-
# the line has already one to avoid to override unit price set manually.
174+
# the line has already one to avoid to override
175+
# unit price set manually.
173176
continue
174177
po_line_uom = line.product_uom or line.product_id.uom_po_id
175178
# Using new cost to compute the price_unit

purchase_product_pack/static/description/index.html

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Purchase Product Pack</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
1010
:Author: David Goodger (goodger@python.org)
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -359,16 +360,21 @@
359360
</style>
360361
</head>
361362
<body>
362-
<div class="document" id="purchase-product-pack">
363-
<h1 class="title">Purchase Product Pack</h1>
363+
<div class="document">
364364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="purchase-product-pack">
370+
<h1>Purchase Product Pack</h1>
365371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
366372
!! This file is generated by oca-gen-addon-readme !!
367373
!! changes will be overwritten. !!
368374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369-
!! source digest: sha256:1c37bc5ae3753d96b784bb15fdbed5dcbe70cafb085cb3ddde5960c03d9c85a7
375+
!! source digest: sha256:c2dac7004783b8033eccca5252ad883ba2106fc36f774bb5680b539f372092be
370376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-pack/tree/18.0/purchase_product_pack"><img alt="OCA/product-pack" src="https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-pack-18-0/product-pack-18-0-purchase_product_pack"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-pack&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-pack/tree/18.0/purchase_product_pack"><img alt="OCA/product-pack" src="https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-pack-18-0/product-pack-18-0-purchase_product_pack"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-pack&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372378
<p>This module adds <em>Product Pack</em> functionality to purchase orders. You
373379
can choose a <em>Pack</em> in <em>purchase order lines</em> and see different
374380
behaviors depending on “Pack type” and “Pack component price” fields
@@ -388,7 +394,7 @@ <h1 class="title">Purchase Product Pack</h1>
388394
</ul>
389395
</div>
390396
<div class="section" id="usage">
391-
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
397+
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
392398
<p>To use this module, you need to:</p>
393399
<ol class="arabic simple">
394400
<li>Go to <em>Purchase &gt; Products &gt; Products</em>, create or select a product
@@ -407,23 +413,23 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
407413
</ol>
408414
</div>
409415
<div class="section" id="bug-tracker">
410-
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
416+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
411417
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-pack/issues">GitHub Issues</a>.
412418
In case of trouble, please check there if your issue has already been reported.
413419
If you spotted it first, help us to smash it by providing a detailed and welcomed
414420
<a class="reference external" href="https://github.com/OCA/product-pack/issues/new?body=module:%20purchase_product_pack%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
415421
<p>Do not contact contributors directly about support or help with technical issues.</p>
416422
</div>
417423
<div class="section" id="credits">
418-
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
424+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
419425
<div class="section" id="authors">
420-
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
426+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
421427
<ul class="simple">
422428
<li>Camptocamp</li>
423429
</ul>
424430
</div>
425431
<div class="section" id="contributors">
426-
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
432+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
427433
<ul class="simple">
428434
<li><a class="reference external" href="https://www.trobz.com">Trobz</a>:<ul>
429435
<li>Duong (Tran Quoc)</li>
@@ -432,17 +438,19 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
432438
</ul>
433439
</div>
434440
<div class="section" id="other-credits">
435-
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
441+
<h3><a class="toc-backref" href="#toc-entry-6">Other credits</a></h3>
436442
<p>Inspired by <em>sale_product_pack</em></p>
437443
<p>The development of this module has been financially supported by:</p>
438444
<ul class="simple">
439445
<li>Camptocamp</li>
440446
</ul>
441447
</div>
442448
<div class="section" id="maintainers">
443-
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
449+
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
444450
<p>This module is maintained by the OCA.</p>
445-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
451+
<a class="reference external image-reference" href="https://odoo-community.org">
452+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
453+
</a>
446454
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
447455
mission is to support the collaborative development of Odoo features and
448456
promote its widespread use.</p>
@@ -451,5 +459,6 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
451459
</div>
452460
</div>
453461
</div>
462+
</div>
454463
</body>
455464
</html>

purchase_product_pack/views/product_pack_line_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<field name="inherit_id" ref="purchase.purchase_order_form" />
88
<field name="arch" type="xml">
99
<xpath
10-
expr="//field[@name='order_line']/tree//field[@name='price_subtotal']"
10+
expr="//field[@name='order_line']/list//field[@name='price_subtotal']"
1111
position="after"
1212
>
1313
<field name="pack_modifiable" invisible="True" />

0 commit comments

Comments
 (0)