Esempio n. 1
0
    def setUpClass(cls, chart_template_ref=None):
        super().setUpClass(chart_template_ref=chart_template_ref)

        (
            cls.stock_input_account,
            cls.stock_output_account,
            cls.stock_valuation_account,
            cls.expense_account,
            cls.stock_journal,
        ) = _create_accounting_data(cls.env)

        cls.product_A = cls.env["product.product"].create(
            {
                "name": "Product A",
                "type": "product",
                "default_code": "prda",
                "categ_id": cls.env.ref("product.product_category_all").id,
                "taxes_id": [(5, 0, 0)],
                "supplier_taxes_id": [(5, 0, 0)],
                "lst_price": 100.0,
                "standard_price": 10.0,
                "property_account_income_id": cls.company_data["default_account_revenue"].id,
                "property_account_expense_id": cls.company_data["default_account_expense"].id,
            }
        )
        cls.product_A.categ_id.write(
            {
                "property_stock_account_input_categ_id": cls.stock_input_account.id,
                "property_stock_account_output_categ_id": cls.stock_output_account.id,
                "property_stock_valuation_account_id": cls.stock_valuation_account.id,
                "property_stock_journal": cls.stock_journal.id,
                "property_valuation": "real_time",
                "property_cost_method": "standard",
            }
        )
 def setUpClass(cls):
     super(TestStockValuationChangeValuation, cls).setUpClass()
     cls.stock_input_account, cls.stock_output_account, cls.stock_valuation_account, cls.expense_account, cls.stock_journal = _create_accounting_data(
         cls.env)
     cls.product1.categ_id.property_valuation = 'real_time'
     cls.product1.write({
         'property_account_expense_id':
         cls.expense_account.id,
     })
     cls.product1.categ_id.write({
         'property_stock_account_input_categ_id':
         cls.stock_input_account.id,
         'property_stock_account_output_categ_id':
         cls.stock_output_account.id,
         'property_stock_valuation_account_id':
         cls.stock_valuation_account.id,
         'property_stock_journal':
         cls.stock_journal.id,
     })
Esempio n. 3
0
    def setUpClass(cls):
        super(TestAngloSaxonValuationPurchaseMRP, cls).setUpClass()
        cls.vendor01 = cls.env['res.partner'].create({'name': "Super Vendor"})

        cls.stock_input_account, cls.stock_output_account, cls.stock_valuation_account, cls.expense_account, cls.stock_journal = _create_accounting_data(
            cls.env)
        cls.avco_category = cls.env['product.category'].create({
            'name':
            'AVCO',
            'property_cost_method':
            'average',
            'property_valuation':
            'real_time',
            'property_stock_account_input_categ_id':
            cls.stock_input_account.id,
            'property_stock_account_output_categ_id':
            cls.stock_output_account.id,
            'property_stock_journal':
            cls.stock_journal.id,
            'property_stock_valuation_account_id':
            cls.stock_valuation_account.id,
        })
 def setUpClass(cls):
     super(TestStockValuationLC, cls).setUpClass()
     cls.productlc1 = cls.env['product.product'].create({
         'name':
         'product1',
         'type':
         'service',
         'categ_id':
         cls.env.ref('product.product_category_all').id,
     })
     cls.stock_input_account, cls.stock_output_account, cls.stock_valuation_account, cls.expense_account, cls.stock_journal = _create_accounting_data(
         cls.env)
     cls.product1.write({
         'property_account_expense_id':
         cls.expense_account.id,
     })
     cls.productlc1.write({
         'property_account_expense_id':
         cls.expense_account.id,
     })
     cls.product1.categ_id.write({
         'property_stock_account_input_categ_id':
         cls.stock_input_account.id,
         'property_stock_account_output_categ_id':
         cls.stock_output_account.id,
         'property_stock_valuation_account_id':
         cls.stock_valuation_account.id,
         'property_stock_journal':
         cls.stock_journal.id,
     })
     cls.payable_account = cls.env['account.account'].create({
         'name':
         'payable',
         'code':
         'payable',
         'user_type_id':
         cls.env.ref('account.data_account_type_payable').id,
         'reconcile':
         True,
     })
Esempio n. 5
0
 def setUpClass(cls):
     super(TestAngloSaxonAccounting, cls).setUpClass()
     cls.env.company.anglo_saxon_accounting = True
     cls.stock_input_account, cls.stock_output_account, cls.stock_valuation_account, cls.expense_account, cls.stock_journal = _create_accounting_data(
         cls.env)
     cls.product1.write({
         'property_account_expense_id':
         cls.expense_account.id,
     })
     cls.product1.categ_id.write({
         'property_valuation':
         'real_time',
         'property_stock_account_input_categ_id':
         cls.stock_input_account.id,
         'property_stock_account_output_categ_id':
         cls.stock_output_account.id,
         'property_stock_valuation_account_id':
         cls.stock_valuation_account.id,
         'property_stock_journal':
         cls.stock_journal.id,
     })
     cls.default_journal_purchase = cls.env['account.journal'].search(
         [('company_id', '=', cls.env.company.id),
          ('type', '=', 'purchase')],
         limit=1)
 def setUp(self):
     super(TestLandedCosts, self).setUp()
     # Create picking incoming shipment
     self.picking_in = self.Picking.create({
         'partner_id':
         self.supplier_id,
         'picking_type_id':
         self.picking_type_in_id,
         'location_id':
         self.supplier_location_id,
         'location_dest_id':
         self.stock_location_id
     })
     self.Move.create({
         'name': self.product_refrigerator.name,
         'product_id': self.product_refrigerator.id,
         'product_uom_qty': 5,
         'product_uom': self.product_refrigerator.uom_id.id,
         'picking_id': self.picking_in.id,
         'location_id': self.supplier_location_id,
         'location_dest_id': self.stock_location_id
     })
     self.Move.create({
         'name': self.product_oven.name,
         'product_id': self.product_oven.id,
         'product_uom_qty': 10,
         'product_uom': self.product_oven.uom_id.id,
         'picking_id': self.picking_in.id,
         'location_id': self.supplier_location_id,
         'location_dest_id': self.stock_location_id
     })
     # Create picking outgoing shipment
     self.picking_out = self.Picking.create({
         'partner_id':
         self.customer_id,
         'picking_type_id':
         self.picking_type_out_id,
         'location_id':
         self.stock_location_id,
         'location_dest_id':
         self.customer_location_id
     })
     self.Move.create({
         'name': self.product_refrigerator.name,
         'product_id': self.product_refrigerator.id,
         'product_uom_qty': 2,
         'product_uom': self.product_refrigerator.uom_id.id,
         'picking_id': self.picking_out.id,
         'location_id': self.stock_location_id,
         'location_dest_id': self.customer_location_id
     })
     self.stock_input_account, self.stock_output_account, self.stock_valuation_account, self.expense_account, self.stock_journal = _create_accounting_data(
         self.env)
     self.categ_all.write({
         'property_stock_account_input_categ_id':
         self.stock_input_account.id,
         'property_stock_account_output_categ_id':
         self.stock_output_account.id,
         'property_stock_valuation_account_id':
         self.stock_valuation_account.id,
         'property_stock_journal':
         self.stock_journal.id,
     })