diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/stock_landed_costs/tests/common.py | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/stock_landed_costs/tests/common.py')
| -rw-r--r-- | addons/stock_landed_costs/tests/common.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/addons/stock_landed_costs/tests/common.py b/addons/stock_landed_costs/tests/common.py new file mode 100644 index 00000000..3ab4984a --- /dev/null +++ b/addons/stock_landed_costs/tests/common.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +from odoo.addons.stock_account.tests.test_anglo_saxon_valuation_reconciliation_common import ValuationReconciliationTestCommon + + +class TestStockLandedCostsCommon(ValuationReconciliationTestCommon): + + @classmethod + def setUpClass(cls, chart_template_ref=None): + super().setUpClass(chart_template_ref=chart_template_ref) + + # Objects + cls.Product = cls.env['product.product'] + cls.Picking = cls.env['stock.picking'] + cls.Move = cls.env['stock.move'] + cls.LandedCost = cls.env['stock.landed.cost'] + cls.CostLine = cls.env['stock.landed.cost.lines'] + # References + cls.warehouse = cls.company_data['default_warehouse'] + cls.supplier_id = cls.env['res.partner'].create({'name': 'My Test Supplier'}).id + cls.customer_id = cls.env['res.partner'].create({'name': 'My Test Customer'}).id + cls.supplier_location_id = cls.env.ref('stock.stock_location_suppliers').id + cls.customer_location_id = cls.env.ref('stock.stock_location_customers').id + cls.categ_all = cls.stock_account_product_categ + cls.expenses_journal = cls.company_data['default_journal_purchase'] + cls.stock_journal = cls.env['account.journal'].create({ + 'name': 'Stock Journal', + 'code': 'STJTEST', + 'type': 'general', + }) + # Create product refrigerator & oven + cls.product_refrigerator = cls.Product.create({ + 'name': 'Refrigerator', + 'type': 'product', + 'standard_price': 1.0, + 'weight': 10, + 'volume': 1, + 'categ_id': cls.categ_all.id}) + cls.product_oven = cls.Product.create({ + 'name': 'Microwave Oven', + 'type': 'product', + 'standard_price': 1.0, + 'weight': 20, + 'volume': 1.5, + 'categ_id': cls.categ_all.id}) + # Create service type product 1.Labour 2.Brokerage 3.Transportation 4.Packaging + cls.landed_cost = cls.Product.create({'name': 'Landed Cost', 'type': 'service'}) + cls.brokerage_quantity = cls.Product.create({'name': 'Brokerage Cost', 'type': 'service'}) + cls.transportation_weight = cls.Product.create({'name': 'Transportation Cost', 'type': 'service'}) + cls.packaging_volume = cls.Product.create({'name': 'Packaging Cost', 'type': 'service'}) |
