Test sale and purchases scenario with payment term in cash rounding

This commit is contained in:
Cédric Krier
2024-01-23 10:55:19 +01:00
parent d36ee557ff
commit 2f6ab00c76
2 changed files with 18 additions and 2 deletions
@@ -8,12 +8,14 @@ Imports::
>>> from proteus import Model
>>> from trytond.modules.account.tests.tools import create_chart, get_accounts
>>> from trytond.modules.account_invoice.tests.tools import create_payment_term
>>> from trytond.modules.company.tests.tools import create_company, get_company
>>> from trytond.tests.tools import activate_modules
Activate modules::
>>> config = activate_modules(['account_cash_rounding', 'purchase'])
>>> config = activate_modules(
... ['account_cash_rounding', 'account_invoice', 'purchase'])
Create company::
@@ -44,11 +46,17 @@ Create party::
>>> party = Party(name='Party')
>>> party.save()
Create payment term::
>>> payment_term = create_payment_term()
>>> payment_term.save()
Create purchase::
>>> Purchase = Model.get('purchase.purchase')
>>> purchase = Purchase()
>>> purchase.party = party
>>> purchase.payment_term = payment_term
>>> line = purchase.lines.new()
>>> line.quantity = 1
>>> line.unit_price = Decimal('42.07')
@@ -8,12 +8,14 @@ Imports::
>>> from proteus import Model
>>> from trytond.modules.account.tests.tools import create_chart, get_accounts
>>> from trytond.modules.account_invoice.tests.tools import create_payment_term
>>> from trytond.modules.company.tests.tools import create_company, get_company
>>> from trytond.tests.tools import activate_modules
Activate modules::
>>> config = activate_modules(['account_cash_rounding', 'sale'])
>>> config = activate_modules(
... ['account_cash_rounding', 'account_invoice', 'sale'])
Create company::
@@ -53,11 +55,17 @@ Create party::
>>> party = Party(name='Party')
>>> party.save()
Create payment term::
>>> payment_term = create_payment_term()
>>> payment_term.save()
Create sale::
>>> Sale = Model.get('sale.sale')
>>> sale = Sale()
>>> sale.party = party
>>> sale.payment_term = payment_term
>>> line = sale.lines.new()
>>> line.quantity = 1
>>> line.unit_price = Decimal('42.02')