Tryton - Issues



Title Not attribute total_seconds() when run sqlite tests and cost is 0 (int)
Priority bug Status closed
Superseder Nosy List pokoli, resteve
Type crash Components project_revenue
Assigned To Keywords

Created on 2017-11-30.15:46:36 by resteve, last changed by pokoli.

msg37291 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-12-14.10:00:24
I'm closing this issue as the scenario is running on our latest trunk:

If you don't agree, please re-open it with the steps to reproduce.
msg37118 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-12-01.09:48:41
I still can not reproduce. See review41701002 for an example scenario which works without problems.
msg37112 (view) Author: [hidden] (resteve) Date: 2017-11-30.21:57:58
The project_revenue has not a scenario rst [1].

To reproduce:

1- Create a scenario rst.
2- Call "cost" field in project. Example:

    >>> Project = Model.get('')
    >>> project = Project()
    >>> = 'Project'
    >>> project.type = 'project'
    >>> = timesheet
    >>> project.product = service
    >>> project.effort_duration = datetime.timedelta(hours=2)
    >>> project.cost
    # crash when cost is 0 (int)

3- Run test in Sqlite

msg37110 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-11-30.15:59:33
Can not reproduce on latest trunk. See:

Could you post the steps to reproduce it?
msg37109 (view) Author: [hidden] (resteve) Date: 2017-11-30.15:46:35
Running tests with Sqlite and project_revenue installed:

      File "/home/resteve/virtualenv/xxx/trytond/trytond/modules/project_revenue/", line 83, in _get_cost
        cost = cost.total_seconds()
    AttributeError: 'int' object has no attribute 'total_seconds'

because cost value is 0 (int) and only check when is a float [1] to do total_seconds()

Date User Action Args
2017-12-14 10:00:24pokolisetstatus: need-eg -> closed
messages: + msg37291
2017-12-01 10:26:13pokolisetstatus: chatting -> need-eg
2017-12-01 09:48:41pokolisetmessages: + msg37118
2017-11-30 21:57:59restevesetmessages: + msg37112
2017-11-30 15:59:33pokolisetnosy: + pokoli
messages: + msg37110
2017-11-30 15:46:36restevecreate

Showing 10 items. Show all history (warning: this could be VERY long)