Stock account configuration french chart of accounts

For this example I will use the French chart of accounts.
Me and my accountant started attempting to implement Tryton by following the product.
In this case we are trying to buy or sell a saleable product.

These are the accounts my accountant would normally use:
Account 371 - 401 for supplier invoice
Account 4111 - 7071 for customer invoice

We did not know where we should configure the 3xx accounts.
So I installed account_stock_continental.

Now we have the following options in the product configuration:
Revenue: we understand this, we selected 7071. Expense: We understand this: 6011.

Then we have stock: we select 371.
Then we have Stock in and Stock out. This we do not understand.
We left stock in and stock out unselected.

If we make a sale or purchase invoice we get this:

 178 6865744913472 [2021-04-02 12:59:43,004] ERROR trytond.protocols.dispatcher <class 'trytond.pool.account.invoice.line'>.on_change_product(*({'invoice': {'allow_cancel': False, 'amount_to_pay_today': None, 'currency': 2, 'currency_digits': 2, 'description': '', 'invoice_date': None, 'number': '', 'party': 720, 'reference': '', 'state': 'draft', 'tax_amount': Decimal('0.00'), 'total_amount': Decimal('0.00'), 'type': 'out', 'untaxed_amount': Decimal('0.00'), 'account': 1012, 'accounting_date': None, 'amount_to_pay': None, 'cancel_move': None, 'comment': '', 'company': 1, 'company_party': 1, 'id': -23, 'invoice_address': 912, 'journal': 1, 'lines_to_pay': [], 'move': None, 'party_lang': 'en', 'party_tax_identifier': 720, 'payment_lines': [], 'payment_term': 12, 'reconciled': None, 'reconciliation_lines': [], 'tax_identifier': None, 'taxes': []}, '_parent_invoice.type': 'out', 'unit': None, '_parent_invoice.party': 720, 'origin': None, '_parent_invoice.accounting_date': None, 'product': 18, 'invoice_type': None, '_parent_invoice.invoice_date': None, 'party': None, 'id': -29, 'company': 1}, {'client': 'dfa8c26d-76ba-451e-9eef-547e19dc588e', 'company': 1, 'company.rec_name': 'LAMPERO GRUP SRL', 'language': 'ro', 'language_direction': 'ltr', 'groups': [7, 8, 1, 4, 2, 5, 18, 3, 6, 12, 13, 10, 9, 11, 19], 'locale': {'date': '%Y-%m-%d', 'grouping': [3, 3, 0], 'decimal_point': '.', 'thousands_sep': ','}, 'type': 'out'}), **{}) from silvia@2a02:a58:6000:3::4//testfr/
Traceback (most recent call last):
  File "/var/trytond/venv/lib/python3.8/site-packages/trytond/protocols/dispatcher.py", line 186, in _dispatch
    result = rpc.result(meth(inst, *c_args, **c_kwargs))
  File "/var/trytond/venv/lib/python3.8/site-packages/trytond/model/modelview.py", line 88, in wrapper
    result = func(self, *args, **kwargs)
  File "/var/trytond/venv/lib/python3.8/site-packages/trytond/model/fields/field.py", line 118, in wrapper
    return func(self, *args, **kwargs)
  File "/var/trytond/venv/lib/python3.8/site-packages/trytond/modules/account_invoice/invoice.py", line 2021, in on_change_product
    pattern = self._get_tax_rule_pattern()
  File "/var/trytond/venv/lib/python3.8/site-packages/trytond/model/fields/field.py", line 118, in wrapper
    return func(self, *args, **kwargs)
  File "/var/trytond/venv/lib/python3.8/site-packages/trytond/modules/account_tax_rule_country/account.py", line 110, in _get_tax_rule_pattern
    PurchaseLine = pool.get('purchase.line')
  File "/var/trytond/venv/lib/python3.8/site-packages/trytond/pool.py", line 187, in get
    return self._pool[self.database_name][type][name]
KeyError: 'purchase.line'

PS: If selling we make sure to have account 4111 configured for receivable account, and 401 for supplier account if buying.

PS2: We have two open periods: Fiscal year 2021 (2021/01/01 - 2021/12/31) and month period april (2021/04/01 - 2021/04/30)

This is explained on Account Stock Continental Module — Tryton module for continental real-time stock valuation

This is a bug which is unrelated to the configuration: Usage of purchase and sale models even when not activated (#10246) · Issues · Tryton / Tryton · GitLab

Silly of me not to activate the purchase module, still a bug though. That takes care of the bug.

Now that we can post customer/supplier invoices we can explore. We will try again to understand.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.