Skip to content

Commit

Permalink
[ADD] testing the 'reserve document number on picking' feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Amaral committed May 31, 2024
1 parent d769789 commit 10cbd48
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions l10n_br_stock_account/tests/test_invoicing_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,24 @@ def test_simples_nacional(self):
invoice.fiscal_document_id,
"Simples Nacional case should has Fiscal Document.",
)

def test_generate_document_number_on_validate(self):
"""Test Invoicing Picking"""
self._change_user_company(self.env.ref("base.main_company"))
picking = self.env.ref("l10n_br_stock_account.main_company-picking_1")
self._run_fiscal_onchanges(picking)
# Testa os Impostos Dedutiveis
picking.fiscal_operation_id.deductible_taxes = True
picking.picking_type_id.pre_generate_fiscal_document_number = "pack"

self._run_fiscal_onchanges(picking)
picking.action_confirm()
picking.action_assign()
for move in picking.move_ids_without_package:
self._run_fiscal_line_onchanges(move)
move.quantity_done = move.product_uom_qty

picking.action_put_in_pack()
picking.button_validate()
picking.set_to_be_invoiced()
self.assertTrue(picking.document_number)

0 comments on commit 10cbd48

Please sign in to comment.