Tryton - Issues



Title Rely less on duration and more on amount
Priority feature Status resolved
Superseder Nosy List ced, edbo, pokoli, reviewbot, roundup-bot
Type feature request Components project_invoice
Assigned To ced Keywords review
Reviews 64441002
View: 64441002

Created on 2018-10-08.16:16:17 by pokoli, last changed by roundup-bot.

New changeset 0ac5c35e6b27 by Cédric Krier in branch 'default':
Remove duration fields and base invoicing on quantity and price
New changeset 0367786244cb by Cédric Krier in branch 'default':
Remove duration fields and base invoicing on quantity and price
review64441002 updated at
review64441002 updated at
msg55137 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-01-30.14:02:27
When testing the updated review i've get the following exception when using manual invoice method:

Traceback (most recent call last):
  File "/trytond/", line 109, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/", line 47, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/", line 77, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/", line 181, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/", line 832, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/trytond/model/fields/", line 105, in get
    return call(names)
  File "/trytond/model/fields/", line 99, in call
    return method(records, name)
  File "/trytond/modules/project/", line 467, in get_total
    values = getattr(cls, '_get_%s' % name)(works)
  File "/trytond/modules/project_invoice/", line 398, in _get_invoiced_amount
    return cls._get_invoice_values(works, 'invoiced_amount')
  File "/trytond/modules/project_invoice/", line 391, in _get_invoice_values
    method = getattr(cls, '_get_%s_%s' % (name, method))
AttributeError: type object '' has no attribute '_get_invoiced_amount_manual'
review64441002 updated at
msg55097 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-01-29.11:43:33
I have updated review64441002 to have a more generic (and customizable) invoice process. Each method must define the quantity and the unit price for the invoice line.
As it is a major change, I took the opportunity to rename the file into for clarity.
Also I put the dedicated method on separate classes. This show how and what to implement for a new method and simplify the reading.
I also introduced two properties invoice_unit_price and unit_to_invoice in order to allow other unit than time based (see issue7853).
Last but not least, to create the invoice line I reuse the same field as those to compute the amount to invoice to enforce coherence.
review64441002 updated at
msg45151 (view) Author: [hidden] (edbo) Date: 2018-12-04.19:17:15
I like the idea to have fixed prices. You can sell a project for a fixed amount, and when the project is done, you can calculate the profit or losses. That can be very handy when you have to make an offer for another project, so you can learn from the past.
review64441002 updated at
New review64441002 at
msg44370 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-10-08.16:16:16
As proposed on
Date User Action Args
2020-03-06 23:34:45roundup-botsetmessages: + msg56133
2020-03-06 23:34:36roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg56132
2020-02-05 17:26:46cedlinkissue7853 superseder
2020-01-30 15:31:43reviewbotsetmessages: + msg55150
2020-01-30 14:15:48reviewbotsetmessages: + msg55139
2020-01-30 14:02:28pokolisetmessages: + msg55137
2020-01-29 11:52:41reviewbotsetmessages: + msg55098
2020-01-29 11:43:33cedsetstatus: in-progress -> testing
messages: + msg55097
2020-01-28 14:40:18cedsetstatus: testing -> in-progress
assignedto: pokoli -> ced
nosy: + ced
2019-01-15 15:14:24reviewbotsetmessages: + msg45972

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