Create company and chart of account when activate modules in test scenario

This commit is contained in:
Cédric Krier
2024-09-11 19:05:12 +02:00
parent d83bcc784c
commit d3cca51abc
335 changed files with 1580 additions and 3035 deletions
@@ -8,7 +8,8 @@ Imports::
>>> from unittest.mock import patch
>>> from proteus import Model
>>> from trytond.modules.company.tests.tools import create_company, get_company
>>> from trytond.modules.company.tests.tools import create_company
>>> from trytond.modules.currency.tests.tools import get_currency
>>> from trytond.modules.stock_shipment_cost.stock import ShipmentCostMixin
>>> from trytond.tests.tools import activate_modules
@@ -20,7 +21,7 @@ Patch _get_shipment_cost::
Activate modules::
>>> config = activate_modules('stock_shipment_cost_weight')
>>> config = activate_modules('stock_shipment_cost_weight', create_company)
>>> Carrier = Model.get('carrier')
>>> Location = Model.get('stock.location')
@@ -29,10 +30,9 @@ Activate modules::
>>> ProductUom = Model.get('product.uom')
>>> Shipment = Model.get('stock.shipment.out')
Create company::
Get currency::
>>> _ = create_company()
>>> company = get_company()
>>> currency = get_currency()
Create customer::
@@ -98,14 +98,14 @@ Create a customer shipment::
>>> move.from_location = output_loc
>>> move.to_location = customer_loc
>>> move.unit_price = Decimal('30')
>>> move.currency = company.currency
>>> move.currency = currency
>>> move = shipment.outgoing_moves.new()
>>> move.product = product2
>>> move.quantity = 2
>>> move.from_location = output_loc
>>> move.to_location = customer_loc
>>> move.unit_price = Decimal('40')
>>> move.currency = company.currency
>>> move.currency = currency
>>> shipment.click('wait')
>>> shipment.click('assign_force')
>>> shipment.click('pick')