Trying to configure tryton for UK accounts

Hi, I am a new UK user as of today and am trying to setup UK accounts as a starting point for my usage.

Is this possible / easy as there is not module for it as far as I can see…?

There is this → GitHub - lampmantech/trytond_accounting_uk_chart: UK Chart of accounts for trytond based on OpenERP l10n_chark_uk_smartmode, but it doesn’t appear to be an official module unfortunately.

How do I add it to → /usr/local/lib/python3.5/dist-packages/trytond/modules

Many thanks in advance

You can manually create the required accounts and taxes on your database by using the menus under account configuration.

Once you have all set and tested, you can create a module to create those records as template and make the chart of accounts available.

Furthermore, you can propose this module to inclusion as oficial module on tryton. In this case it will be great to provide links to the oficial documents where the chart of accounts and taxes is define so we can give some feedback about the desing.

You have to create a derivative image which installs the module on your database. Here is a sample dockerfile:

FROM tryton/tryton:4.8-office                                                                                                
USER root                                                                      
# Install module and it's dependencies                                         
RUN pip3 install --process-dependency-links \                                  
<module_git_url> . \ 
&& rm -rf /root/.cache                                                     
USER trytond  

Hope it helps

Hi @pokoli

Thanks for your detailed response and yes it has helped thank you.

I wasn’t able to find a Dockerfile to the official docker so I am able to modify. I will have to do some more searching in the code repo, unless you are able to point me too it :slight_smile:

Edit: Oh I reread and you mention derivative image, I see, so I use that image and it pulls in the rest. I am not using the ‘office’ version as not found the difference documented, or I have just missed it from the install docs.

I am also a noob with accounting as its my first year submitting accounts and I am therefore trying to get guidance on the best accounts to use.

That is why I thought I would try this one on github from another user first, to get familiar first.

The testing sounds ominous, not sure what the testing would involve, but will continue trying to get tryton to work for me.

Thanks

You can use the tryton image as from if you want. The office image includes libreoffice software which is required to convert the reports from odt to pdf.

Normally there is official document from the legal authority that lists all the available accounts and explains their usage. For example here is the one for the Spanish Chart of Accounts.

Sorry but can not help on this topic as I do not have any knowledge about UK accounting but feel free to ask any usage doubt you have about tryton :wink:

For example some test may include:

  • Generate a move for an account and test that is reported an test the correctness of Profit and Loss, and Balance Reports
  • Generate an invoice with tax and test it is reported on the correct tax code and with the correct sign.
  • Test that tax rules are applied correctly on invoices.

Basically what it’s need to be tested is that the data is correctly defined

Thanks yes I have created a new docker build with your suggested docker and although created the build fails on the pip install

root@6e558da41bc3:/# pip3 install --process-dependency-links …
Collecting …
Downloading GitHub - lampmantech/trytond_accounting_uk_chart: UK Chart of accounts for trytond based on OpenERP l10n_chark_uk_smartmode
- 92kB 167kB/s
Cannot unpack file /tmp/pip-b8a1q17w-unpack/trytond_accounting_uk_chart (downloaded from /tmp/pip-klgfy06g-build, content-type: text/html; charset=utf-8); cannot detect archive format
Cannot determine archive format of /tmp/pip-klgfy06g-build

It says I can just git pull into the modules directory directly, so am trying that way now, without pip install.

edit: Sadly there are errors, which I guess is expected with no development for 2 years :frowning:

*** Operational MODE: single process ***
/usr/local/lib/python3.5/dist-packages/trytond/modules/init.py:143: DeprecationWarning: This method will be removed in future versions. Use ‘parser.read_file()’ instead.
module_config.readfp(fp)
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/trytond/application.py”, line 18, in <module>
Pool.start()
File “/usr/local/lib/python3.5/dist-packages/trytond/pool.py”, line 102, in start
register_classes()
File “/usr/local/lib/python3.5/dist-packages/trytond/modules/init.py”, line 378, in register_classes
mod_file, pathname, description)
File “/usr/lib/python3.5/imp.py”, line 244, in load_module
return load_package(name, filename)
File “/usr/lib/python3.5/imp.py”, line 216, in load_package
return _load(spec)
File “/usr/local/lib/python3.5/dist-packages/trytond/modules/account_uk/init.py”, line 3, in <module>
from .account import *
File “/usr/local/lib/python3.5/dist-packages/trytond/modules/account_uk/account.py”, line 26, in <module>
from itertools import izip, groupby
ImportError: cannot import name ‘izip’
unable to load app 0 (mountpoint=‘’) (callable not found or import error)

I have also duplicated my working tryton and db to test this on and going into the docker as root the pip install fails as well, as it seems the syntax of the pip command is not correct from what I can see at the moment.

Sure I understand, I guess what I am saying is that for the moment I may be better off using the account_eu rather than the account module perhaps just to get an initial basic set of accounts without payroll, vat etc etc, as I have just started my business?

I have added an issue to the github of the uk account to see if it worked previously or needed more people to test.

lampmantech had created an android app too, so does anyone know the history here, as they seem to stop work on all things Tryton 2 years or so ago?

My issue is that I am not familiar enough to know if moves etc are failing to test a UK specific account.

So as the old UK specific module no longer works (if it ever did?) and doesn’t seem to have a dev anymore.

I guess I continue with the default accounts module.

I am not an accountant, but I don’t think that there is a standard chart of accounts and taxes defined for use in the UK (wikipedia article on Chart of Accounts).

There is the UK GAAP, and the various Financial Reporting Standards, but I don’t think a chart of accounts is specified, only what should appear on things like the balance sheet and profit and loss reports?

I am also interested in having an account_uk module, and would be happy to help create/update/test it, but I only have some basic accountancy knowledge.

I’d be happy too, but @pokoli would there be any appetite from the team / yourself to incorporate / update the code for a UK account and we could update the 2017 excahnge rate tables etc that appear to be contained in XML files?

I am very new to this so may be vastly over simplifying :slight_smile: but if the module worked as a beta, ‘we’ the royal we, could try and get a working uk account?

The links on github I shared appeared to copy the code from account_be back then and additional code added, although I am not sure how much would be needed to make the github version work as a beta for us to test at least?

There is a UK statement of account (thanks @dave for the info) that I am also trying in gnucash, so that could perhaps be used as a basis and I could we could run the beta uk version accross our accountants for their input (once I have one!)

Your thoughts?

This reported error is because the module is developed on Python2 but the docker image uses Python3 (which is the only supported version starting from the next release)

Another option is to update the module to make it work on default version. I think this will be a better starting point, as you will have to manually create manually most of the taxes and accounts.

Thanks for the feedback.

I was rather hoping that these account files used generic python code that would be contained in the ‘account’ module and would be maintained to work with the latest builds of tryton and would then be utilised by the other country modules, with just user editable xml files that would change the way each country accounted for their taxes etc.

I have misunderstood that each module needs new python coding to make them country specific.

Indeed for a basic accounting module your hope is right. The chart of accounts normally include only xml files which contains the configuration for accounts and taxes templates. They may include some specific reports for that are required for the country but for starting point you can start with only the xml definition.

After a review of the module I see that it includes and Abbreviated accounts reports which I don’t know if it’s a specific requirement for UK or it can be removed. Probably the same information can be exported by Using the Trial Balance option of the General Ledger Report.

Thanks for your continued help, it is appreciated :slight_smile:

Initially getting trytond_accounting_uk working would be a good start, which appears to be intended to be the basic accounting structure for the uk?

The decimal exchange rates are available, so presume can be manually edited to give the current rates.

I am going to start work on upgrading / creating an initial UK accounting module. Do you think it is best to open an RFC on the bug tracker for a account_uk module?

If you have somethink that is working and it can be installed on the latest trunk it will be a good step.
But please explain which is the source of the chart of accounts, including a link on the docs folder of the module will be very welcome.

I’m cuirious why the module includes the exchanges rates.
Is there any legal requirment to use the ones included on the module?
Why the historical data is required?

The rates are published by HMRC (the UK Tax Authority) and are one method that can be used when converting transactions in foreign currencies to Sterling for VAT purposes.

I see that this is not the only option as it also accepts the rates published on the newspaper. That makes me think that we should not include the rates on the account_uk module and it should be manually managed by the user by entering the desired exchange rates in the application.

I see there is also a webservice for downloading the rates, maybe we can include some cron job to download the rates but I don’t think they should be hardcoded on xml.

1 Like

Excellent news and thank you.

Downloading the rates would be great rather than having to manually enter them at any point; hard coded or otherwise.

I am making steady progress, and have been doing quite a bit of learning and research. I have some notes, and questions.

I fully agree that the exchange rates should not be included in a uk accounts module.

The Abbreviated Accounts format has been abolished with changes in 2015 to uk law and can no longer be used when filing accounts.

Looking at the accounting_uk module README by lampmantech, he correctly points out that in the UK there could be many different legal charts of account. Each of these made for a different business sector (service, manufacturing, etc), and/or type of company (sole trader, partnership, limited company, etc).

Based on this I am wondering what is the best way of structuring the account_uk module? I can see a few alternatives:

  • A single account_uk module that includes everything for as many types of company and business as possible.

    I don’t think this is a great solution because it will mean that companies have accounts and reports that they will then have to ignore or deactivate, and is not in keeping with the modular approach of the rest of Tryton.

  • Many different account_uk_* modules, each of which would contain the chart of accounts, data, reports and code for a specific business sector and company type.

    I don’t think this is a good idea because with separate charts of account for each sector and company type, things like common accounts would then have to be duplicated in each module. Also with separate charts of account I don’t think there will be much that could be shared between these modules, as I think taxes for example, are be linked to an account.account.template.

  • An account_uk module that contains any common reports, taxes and a basic chart of accounts, and then additional modules that add additional accounts and reports that are specific to the company type or business sector.

    The idea is that multiple account_uk_* modules would then be installed to provide the appropriate functionality. e.g. a UK limited company that provides services and also does some manufacturing could then install the account_uk, account_uk_limited_company, account_uk_service, and account_uk_manufacturing modules.

    This is my preferred option. One disadvantage may be for multiple company setups, from what I can see they would end up with the same type of charts of account for each company, even when each company may ideally have a different setup.

I welcome any feedback or comments.

To be able to advise, we should know what are the differences between those charts.
Do they have incompatible accounts like two account with the same code but different purpose? If no, for me, there should be only one chart of account with everything strictly needed.
We have an example with Spain where there are two charts (for small and large business) which are incompatible together because the some accounts with the same code do not have the same purpose. But this is a solution that should be avoid if possible because it is more complex.
I do not see any problem to have more complete chart for a company with accounts that it does not use.

I do not understand who reports could be different. The general legder, balance sheet, income statement etc. should not be that different and neither the tax reporting. Could you point what are the differences?