Skip to content

Commit 81d5d2f

Browse files
German Loredo [Vauxoo]carlos-lopez-tecnativa
authored andcommitted
[MIG] product_supplierinfo_for_customer_sale: Migration to 17.0
1 parent 82b9bae commit 81d5d2f

6 files changed

Lines changed: 64 additions & 61 deletions

File tree

product_customerinfo_sale/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Product Supplierinfo for Customer Sale
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:c9056beb4457a5a0fd5a9c0fabbc4638cac7b1b146b088ba5c64545c6f172274
10+
!! source digest: sha256:04cc681010b340a9ec28530ccc30811372460de03556f9302e1d5f3cabf71b85
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png

product_customerinfo_sale/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
55
{
66
"name": "Product Supplierinfo for Customer Sale",
7-
"version": "16.0.1.0.2",
7+
"version": "17.0.1.0.0",
88
"summary": "Loads in every sale order line the customer code defined "
99
"in the product",
1010
"author": "Agile Business Group,Vauxoo,Odoo Community Association (OCA)",

product_customerinfo_sale/i18n/product_supplierinfo_for_customer_sale.pot

Lines changed: 1 addition & 1 deletion
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 17.0\n"
88
"Report-Msgid-Bugs-To: \n"
99
"Last-Translator: \n"
1010
"Language-Team: \n"

product_customerinfo_sale/static/description/index.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
/*
1010
:Author: David Goodger (goodger@python.org)
11-
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
11+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z 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.
1615
1716
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1817
customize this style sheet.
@@ -275,7 +274,7 @@
275274
margin-left: 2em ;
276275
margin-right: 2em }
277276

278-
pre.code .ln { color: gray; } /* line numbers */
277+
pre.code .ln { color: grey; } /* line numbers */
279278
pre.code, code { background-color: #eeeeee }
280279
pre.code .comment, code .comment { color: #5C6576 }
281280
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +300,7 @@
301300
span.pre {
302301
white-space: pre }
303302

304-
span.problematic, pre.problematic {
303+
span.problematic {
305304
color: red }
306305

307306
span.section-subtitle {
@@ -367,7 +366,7 @@ <h1 class="title">Product Supplierinfo for Customer Sale</h1>
367366
!! This file is generated by oca-gen-addon-readme !!
368367
!! changes will be overwritten. !!
369368
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:c9056beb4457a5a0fd5a9c0fabbc4638cac7b1b146b088ba5c64545c6f172274
369+
!! source digest: sha256:04cc681010b340a9ec28530ccc30811372460de03556f9302e1d5f3cabf71b85
371370
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372371
<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/sale-workflow/tree/17.0/product_supplierinfo_for_customer_sale"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-product_supplierinfo_for_customer_sale"><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/sale-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373372
<p>Based on product_supplierinfo_for_customer, this module loads in every
@@ -457,9 +456,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
457456
<div class="section" id="maintainers">
458457
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
459458
<p>This module is maintained by the OCA.</p>
460-
<a class="reference external image-reference" href="https://odoo-community.org">
461-
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
462-
</a>
459+
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
463460
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
464461
mission is to support the collaborative development of Odoo features and
465462
promote its widespread use.</p>

product_customerinfo_sale/tests/test_product_name_search.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@ class TestProductNameSearch(TransactionCase):
1010
- Test product name_search
1111
"""
1212

13-
def setUp(self):
14-
super(TestProductNameSearch, self).setUp()
15-
self.supplier = self.env.ref("base.res_partner_1")
16-
self.customer = self.env.ref("base.res_partner_2")
17-
self.product = (
18-
self.env["product.product"]
13+
@classmethod
14+
def setUpClass(cls):
15+
super().setUpClass()
16+
cls.supplier = cls.env.ref("base.res_partner_1")
17+
cls.customer = cls.env.ref("base.res_partner_2")
18+
cls.product = (
19+
cls.env["product.product"]
1920
.create({"name": "Name_product", "default_code": "code_product"})
20-
.with_context(**{"partner_id": self.customer.id})
21+
.with_context(**{"partner_id": cls.customer.id})
2122
)
22-
self.supplierinfo = self.env["product.supplierinfo"]
23-
self.customerinfo = self.env["product.customerinfo"]
24-
self.customerinfo_dict = {
23+
cls.supplierinfo = cls.env["product.supplierinfo"]
24+
cls.customerinfo = cls.env["product.customerinfo"]
25+
cls.customerinfo_dict = {
2526
"product_code": "code_test",
2627
"product_name": "Name_test",
27-
"partner_id": self.customer.id,
28-
"product_tmpl_id": self.product.product_tmpl_id.id,
28+
"partner_id": cls.customer.id,
29+
"product_tmpl_id": cls.product.product_tmpl_id.id,
2930
}
3031

3132
def test_10_find_product_customer_code(self):

product_customerinfo_sale/tests/test_product_supplierinfo_for_customer_sale.py

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,52 @@
77

88

99
class TestProductSupplierinfoForCustomerSale(TransactionCase):
10-
def setUp(self):
11-
super().setUp()
12-
self.supplierinfo_model = self.env["product.supplierinfo"]
13-
self.customerinfo_model = self.env["product.customerinfo"]
14-
self.pricelist_item_model = self.env["product.pricelist.item"]
15-
self.pricelist_model = self.env["product.pricelist"]
16-
self.customer = self._create_customer("customer1")
17-
self.product = self.env.ref("product.product_product_4")
18-
self.product_variant_1 = self.env.ref("product.product_product_4b")
19-
self.product_variant_2 = self.env.ref("product.product_product_4c")
20-
self.customerinfo = self._create_partnerinfo(
21-
"customer", self.customer, self.product
22-
)
23-
self.pricelist = self._create_pricelist("Test Pricelist", self.product)
24-
self.pricelist_item = self._create_pricelist_item(
25-
"Test Pricelist Item", self.pricelist, self.product
26-
)
27-
self.company = self.env.ref("base.main_company")
28-
self._create_partnerinfo("customer", self.customer, self.product_variant_1)
29-
self._create_partnerinfo(
30-
"customer", self.customer, self.product_variant_2, empty_variant=True
31-
)
32-
self.product_template = self.env["product.template"].create(
10+
@classmethod
11+
def setUpClass(cls):
12+
super().setUpClass()
13+
cls.supplierinfo_model = cls.env["product.supplierinfo"]
14+
cls.customerinfo_model = cls.env["product.customerinfo"]
15+
cls.pricelist_item_model = cls.env["product.pricelist.item"]
16+
cls.pricelist_model = cls.env["product.pricelist"]
17+
cls.customer = cls._create_customer("customer1")
18+
cls.product = cls.env.ref("product.product_product_4")
19+
cls.product_variant_1 = cls.env.ref("product.product_product_4b")
20+
cls.product_variant_2 = cls.env.ref("product.product_product_4c")
21+
cls.customerinfo = cls._create_partnerinfo(
22+
"customer", cls.customer, cls.product
23+
)
24+
cls.pricelist = cls._create_pricelist("Test Pricelist", cls.product)
25+
cls.pricelist_item = cls._create_pricelist_item(
26+
"Test Pricelist Item", cls.pricelist, cls.product
27+
)
28+
cls.company = cls.env.ref("base.main_company")
29+
cls._create_partnerinfo("customer", cls.customer, cls.product_variant_1)
30+
cls._create_partnerinfo(
31+
"customer", cls.customer, cls.product_variant_2, empty_variant=True
32+
)
33+
cls.product_template = cls.env["product.template"].create(
3334
{"name": "product wo variants"}
3435
)
35-
self._create_partnerinfo(
36+
cls._create_partnerinfo(
3637
"customer",
37-
self.customer,
38-
self.product_template.product_variant_ids[:1],
38+
cls.customer,
39+
cls.product_template.product_variant_ids[:1],
3940
empty_variant=True,
4041
)
41-
self.pricelist_template = self._create_pricelist(
42-
"Test Pricelist Template", self.product_template.product_variant_ids[:1]
42+
cls.pricelist_template = cls._create_pricelist(
43+
"Test Pricelist Template", cls.product_template.product_variant_ids[:1]
4344
)
44-
self.env.user.groups_id |= self.env.ref("product.group_product_pricelist")
45+
cls.env.user.groups_id |= cls.env.ref("product.group_product_pricelist")
4546

46-
def _create_customer(self, name):
47-
return self.env["res.partner"].create(
47+
@classmethod
48+
def _create_customer(cls, name):
49+
return cls.env["res.partner"].create(
4850
{"name": name, "email": "example@yourcompany.com", "phone": 123456}
4951
)
5052

53+
@classmethod
5154
def _create_partnerinfo(
52-
self, supplierinfo_type, partner, product, empty_variant=False
55+
cls, supplierinfo_type, partner, product, empty_variant=False
5356
):
5457
vals = {
5558
"partner_id": partner.id,
@@ -62,15 +65,17 @@ def _create_partnerinfo(
6265
if empty_variant:
6366
vals.pop("product_id", None)
6467
vals["product_tmpl_id"] = product.product_tmpl_id.id
65-
return self.env["product." + supplierinfo_type + "info"].create(vals)
68+
return cls.env["product." + supplierinfo_type + "info"].create(vals)
6669

67-
def _create_pricelist(self, name, product):
68-
return self.pricelist_model.create(
69-
{"name": name, "currency_id": self.env.ref("base.USD").id}
70+
@classmethod
71+
def _create_pricelist(cls, name, product):
72+
return cls.pricelist_model.create(
73+
{"name": name, "currency_id": cls.env.ref("base.USD").id}
7074
)
7175

72-
def _create_pricelist_item(self, name, pricelist, product):
73-
return self.pricelist_item_model.create(
76+
@classmethod
77+
def _create_pricelist_item(cls, name, pricelist, product):
78+
return cls.pricelist_item_model.create(
7479
{
7580
"name": name,
7681
"pricelist_id": pricelist.id,

0 commit comments

Comments
 (0)