From 932e2ee9ed8694ff43d41c09fe9b68169bb527bf Mon Sep 17 00:00:00 2001 From: Dorin Hongu Date: Wed, 3 Jan 2024 17:26:42 +0200 Subject: [PATCH] adaugare testscript --- deltatech_stock_valuation/README.rst | 2 +- deltatech_stock_valuation/__manifest__.py | 2 +- .../models/res_company.py | 5 +- .../static/description/index.html | 2 +- deltatech_stock_valuation/tests/__init__.py | 5 + .../tests/test_stock_valuation.py | 119 ++++++++++++++++++ 6 files changed, 130 insertions(+), 5 deletions(-) create mode 100644 deltatech_stock_valuation/tests/__init__.py create mode 100644 deltatech_stock_valuation/tests/test_stock_valuation.py diff --git a/deltatech_stock_valuation/README.rst b/deltatech_stock_valuation/README.rst index 23f79c9b77..0de9532bfd 100644 --- a/deltatech_stock_valuation/README.rst +++ b/deltatech_stock_valuation/README.rst @@ -7,7 +7,7 @@ Product Valuation !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:33959730018c9387a7ec885775c0defca536f43dedde3733f43288f3066e2ffc + !! source digest: sha256:8eab2c74d7882455da233440e00230d9cb2b775f7dad006976ef0347213375a0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png diff --git a/deltatech_stock_valuation/__manifest__.py b/deltatech_stock_valuation/__manifest__.py index 40fe30ef0c..5b711ec2c0 100644 --- a/deltatech_stock_valuation/__manifest__.py +++ b/deltatech_stock_valuation/__manifest__.py @@ -10,7 +10,7 @@ "author": "Terrabit, Dorin Hongu", "website": "https://www.terrabit.ro", "category": "Inventory/Inventory", - "depends": ["stock_account"], + "depends": ["stock_account", "l10n_ro"], "license": "OPL-1", "data": [ "security/ir.model.access.csv", diff --git a/deltatech_stock_valuation/models/res_company.py b/deltatech_stock_valuation/models/res_company.py index 8901648fb4..490c97428d 100644 --- a/deltatech_stock_valuation/models/res_company.py +++ b/deltatech_stock_valuation/models/res_company.py @@ -18,14 +18,15 @@ class ResCompany(models.Model): valuation_area_id = fields.Many2one("valuation.area", string="Valuation Area") def set_stock_valuation_at_company_level(self): + self.ensure_one() if self.valuation_area_level != "company": return if not self.valuation_area_id: valuation_area = self.env["valuation.area"].create( { - "name": self.company_id.name, - "company_id": self.company_id.id, + "name": self.name, + "company_id": self.id, } ) self.valuation_area_id = valuation_area.id diff --git a/deltatech_stock_valuation/static/description/index.html b/deltatech_stock_valuation/static/description/index.html index 858d38c54b..955817cb56 100644 --- a/deltatech_stock_valuation/static/description/index.html +++ b/deltatech_stock_valuation/static/description/index.html @@ -367,7 +367,7 @@

Product Valuation

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:33959730018c9387a7ec885775c0defca536f43dedde3733f43288f3066e2ffc +!! source digest: sha256:8eab2c74d7882455da233440e00230d9cb2b775f7dad006976ef0347213375a0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Alpha License: OPL-1 dhongu/deltatech

Features:

diff --git a/deltatech_stock_valuation/tests/__init__.py b/deltatech_stock_valuation/tests/__init__.py new file mode 100644 index 0000000000..35178dac7a --- /dev/null +++ b/deltatech_stock_valuation/tests/__init__.py @@ -0,0 +1,5 @@ +# © 2024 Deltatech +# Dorin Hongu