Skip to content

Commit 65e808b

Browse files
committed
[IMP] product_code_mandatory: Add review improvements
1 parent 5946343 commit 65e808b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

product_code_mandatory/models/product.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def _get_default_code(self):
1111
return self.env["ir.sequence"].next_by_code("product.default.code")
1212

1313
default_code = fields.Char(
14-
"Internal Reference", index=True, default=_get_default_code
14+
"Internal Reference", index=True, default=lambda self: self._get_default_code()
1515
)

product_code_mandatory/tests/test_product_code.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
22

3-
from odoo.tests.common import TransactionCase
3+
from odoo.tests.common import BaseCommon
44

55

6-
class TestProductCode(TransactionCase):
6+
class TestProductCode(BaseCommon):
77
@classmethod
88
def setUpClass(cls):
99
super().setUpClass()

0 commit comments

Comments
 (0)