Guide to get a basic development environment

Let’s take an example. I have filed Extend format_date function to allow a format other then the default (#8444) · Issues · Tryton / Tryton · GitLab. I made the changes locally on my Tryton development system and want to submit them to be accepted. I started upload.py and it asks for

New issue subject:

So the answer to that question will be

trytond: Extend format_date function to allow a format other then the default

Am I right?

I think so. Repository name: Title of the review.

So I added

trytond: Extend format_date function to allow a format other then the default

And my webbrowser opens up an new tab because I had to login into my google account. After I did that, the changes were successfully uploaded to the codereview.

So I think that you have to mention on the website that you have to have a google-account in order to upload patches.
Also when is an entry needed for the Changelog?

Really I guess you have to have some account oauth2 compatible (not only google)

Currently a google account is required as we are hosting our codereview instance on google app engine. There is Being less Google dependent (#2177) · Issues · Tryton / Tryton · GitLab in order to improve it but is still unresolved.

I’m working on a new patch for review and testing the improved guide before upload it I get requirements.txt and requirements-dev. txt files created :slightly_smiling_face: but not the trytond modules symlinks…

Any thoughts??

I guess you did not put the hook:

update = .hooks/link_modules

Nope.

Those are my last lines:

[ui]
# name and email (local to this repository, optional), e.g.
# username = Jane Doe <jdoe@example.co m>

[hooks]
update = .hooks/link_modules
update = .hooks/update_requirements

Indeed, creation of requirements files is working…

Indeed the hook names should have a suffix otherwise only the last one is run.
I pushed http://hg.tryton.org/tryton-env/rev/546379195e07 which updates the README accordingly.

A new patch ha been uploaded to review.

Hi,

Precision on use:

  1. I created an issue
  2. I made my changes to the code
  3. I used ‘upload.py’ to submit my changes
  4. I have informed the subject

But I did not find the place to indicates the number of the issue that I created in point 1 (the description field as said on the website ‘Submit a Change’) ?

regards.

You have to put in the description of the review (using “Edit issue” link) the number of the “issuexxxx”. The reviewbot will make the link on the bugtracker automatically.

Just to add to what @ced said.

If you use the -m flag you can specify the issue number when you first upload the review, so you don’t then need to go in and use the Edit issue link - e.g.:

upload.py -t "trytond: Allow timedelta fields to be imported from csv file" -m "issue9220"

Then, when you want to make some corrections or changes to the review you’ve previously uploaded you would do something like this:

upload.py -t "Fix line that is too long" -i 313251002

Where 313251002 is the codereview number. This will create a 2nd (or 3rd, …) patch set on the review. The new upload will supersede the older ones, but you will still be able to see the old patch sets, and will be able to compare changes between them.

Hope that helps!

2 Likes

Thank you @dave for these details.

1 Like

Is there a default configuration file? can it be generated? must it be written by hand? I don’t find it. :sweat_smile:

trytond starts with “good” default values that are described in Configuration file for Tryton — trytond latest documentation
So you need to create a configuration only if you want to change the default value and set only those new values (the others will still be set to default).

I clone tryton-env and when i play this command trytond-admin -c …/…/tryton-env/tryton.conf -d mabasetryton --all -v , with tryton.conf look like:

[database]
uri = postgresql://login:password@localhost:5432/

i have this error
could not load ../../tryton-env/tryton.conf
Traceback (most recent call last):
  File "/home/delphine/dev/tryton/venv/bin/trytond-admin", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/delphine/dev/tryton/tryton-env/trytond/bin/trytond-admin", line 23, in <module>
    admin.run(options)
  File "/home/delphine/dev/tryton/tryton-env/trytond/trytond/admin.py", line 27, in run
    database.connect()
  File "/home/delphine/dev/tryton/tryton-env/trytond/trytond/backend/sqlite/database.py", line 358, in connect
    self._make_uri(), uri=True,
  File "/home/delphine/dev/tryton/tryton-env/trytond/trytond/backend/sqlite/database.py", line 432, in _make_uri
    raise IOError("Database '%s' doesn't exist!" % db_path)
OSError: Database '/home/delphine/db/mabasetryton.sqlite' doesn't exist!

The path or access rights are not correct.

thank you it’s good.