Skip to content

Commit

Permalink
check tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed Jun 9, 2023
1 parent 21709ed commit 4285c1a
Showing 1 changed file with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,46 @@ class TestStockValuation(TestStockValuation):
def setUp(self):
super(TestStockValuation, self).setUp()

# def test_stock_picking_accounting_date(self):
# self.product1.categ_id.property_cost_method = "fifo"
# accounting_date = date.today() + timedelta(days=1)
# receipt = self.env["stock.picking"].create(
# {
# "location_id": self.supplier_location.id,
# "location_dest_id": self.stock_location.id,
# "partner_id": self.partner.id,
# "picking_type_id": self.env.ref("stock.picking_type_in").id,
# "accounting_date": accounting_date,
# }
# )
def test_stock_picking_accounting_date(self):
self.product1.categ_id.property_cost_method = "fifo"
accounting_date = date.today() + timedelta(days=1)
receipt = self.env["stock.picking"].create(
{
"location_id": self.supplier_location.id,
"location_dest_id": self.stock_location.id,
"partner_id": self.partner.id,
"picking_type_id": self.env.ref("stock.picking_type_in").id,
"accounting_date": accounting_date,
}
)

# move = self.env["stock.move"].create(
# {
# "picking_id": receipt.id,
# "name": "10 in",
# "location_id": self.supplier_location.id,
# "location_dest_id": self.stock_location.id,
# "product_id": self.product1.id,
# "product_uom": self.uom_unit.id,
# "product_uom_qty": 10.0,
# "price_unit": 10,
# "move_line_ids": [
# (
# 0,
# 0,
# {
# "product_id": self.product1.id,
# "location_id": self.supplier_location.id,
# "location_dest_id": self.stock_location.id,
# "product_uom_id": self.uom_unit.id,
# "qty_done": 10.0,
# },
# )
# ],
# }
# )
# move._action_confirm()
# move._action_done()
# self.assertEqual(
# move.stock_valuation_layer_ids.account_move_id.date, accounting_date
# )
move = self.env["stock.move"].create(
{
"picking_id": receipt.id,
"name": "10 in",
"location_id": self.supplier_location.id,
"location_dest_id": self.stock_location.id,
"product_id": self.product1.id,
"product_uom": self.uom_unit.id,
"product_uom_qty": 10.0,
"price_unit": 10,
"move_line_ids": [
(
0,
0,
{
"product_id": self.product1.id,
"location_id": self.supplier_location.id,
"location_dest_id": self.stock_location.id,
"product_uom_id": self.uom_unit.id,
"qty_done": 10.0,
},
)
],
}
)
move._action_confirm()
move._action_done()
self.assertEqual(
move.stock_valuation_layer_ids.account_move_id.date, accounting_date
)

0 comments on commit 4285c1a

Please sign in to comment.