Debian Codegraph @

addons/stock_landed_costs/tests/common.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2
3 from odoo.addons.stock_account.tests.test_anglo_saxon_valuation_reconciliation_common import ValuationReconciliationTestCommon
4
5
6 class TestStockLandedCostsCommon(ValuationReconciliationTestCommon):
7
8 @classmethod
9 def setUpClass(cls):
10 super().setUpClass()
11
12 # Objects
13 cls.Product = cls.env['product.product']
14 cls.Picking = cls.env['stock.picking']
15 cls.Move = cls.env['stock.move']
16 cls.LandedCost = cls.env['stock.landed.cost']
17 cls.CostLine = cls.env['stock.landed.cost.lines']
18 # References
19 cls.warehouse = cls.company_data['default_warehouse']
20 cls.supplier_id = cls.env['res.partner'].create({'name': 'My Test Supplier'}).id
21 cls.customer_id = cls.env['res.partner'].create({'name': 'My Test Customer'}).id
22 cls.supplier_location_id = cls.env.ref('stock.stock_location_suppliers').id
23 cls.customer_location_id = cls.env.ref('stock.stock_location_customers').id
24 cls.categ_all = cls.stock_account_product_categ
25 cls.categ_manual_periodic = cls.env.ref('product.product_category_goods').copy({
26 "property_valuation": "periodic",
27 "property_cost_method": "fifo"
28 })
29 cls.categ_real_time = cls.env.ref('product.product_category_goods').copy({
30 "property_valuation": "real_time",
31 "property_cost_method": "average"
32 })
33 cls.expenses_journal = cls.company_data['default_journal_purchase']
34 cls.stock_journal = cls.env['account.journal'].create({
35 'name': 'Stock Journal',
36 'code': 'STJTEST',
37 'type': 'general',
38 })
39 # Create product refrigerator & oven
40 cls.product_refrigerator = cls.Product.create({
41 'name': 'Refrigerator',
42 'is_storable': True,
43 'standard_price': 1.0,
44 'weight': 10,
45 'volume': 1,
46 'categ_id': cls.categ_real_time.id})
47 cls.product_oven = cls.Product.create({
48 'name': 'Microwave Oven',
49 'is_storable': True,
50 'standard_price': 1.0,
51 'weight': 20,
52 'volume': 1.5,
53 'categ_id': cls.categ_real_time.id})
54 # Create service type product 1.Labour 2.Brokerage 3.Transportation 4.Packaging
55 cls.landed_cost = cls.Product.create({'name': 'Landed Cost', 'type': 'service', 'categ_id': cls.product_category.id})
56 cls.brokerage_quantity = cls.Product.create({'name': 'Brokerage Cost', 'type': 'service', 'categ_id': cls.categ_all.id})
57 cls.transportation_weight = cls.Product.create({'name': 'Transportation Cost', 'type': 'service', 'categ_id': cls.categ_all.id})
58 cls.packaging_volume = cls.Product.create({'name': 'Packaging Cost', 'type': 'service', 'categ_id': cls.categ_all.id})