Tryton - Issues

 

Issue6507

Title Inactive fields in Statement Lines
Priority bug Status resolved
Superseder Nosy List Artem, ced, pokoli, reviewbot, roundup-bot, unicode2013
Type behavior Components account_statement
Assigned To ced Keywords review
Reviews 41331002,42381002
View: 41331002, 42381002

Created on 2017-05-15.12:01:27 by Artem, last changed by roundup-bot.

Messages
New changeset 1a9d74f3af85 by Cédric Krier in branch '4.4':
Add statement to editable line view
http://hg.tryton.org/modules/account_statement/rev/1a9d74f3af85

New changeset 85a1c19da9c4 by Cédric Krier in branch '4.2':
Add statement to editable line view
http://hg.tryton.org/modules/account_statement/rev/85a1c19da9c4

New changeset 4912e39a11b3 by Cédric Krier in branch '4.0':
Add statement to editable line view
http://hg.tryton.org/modules/account_statement/rev/4912e39a11b3

New changeset 7a83a2851a18 by Cédric Krier in branch '3.8':
Add statement to editable line view
http://hg.tryton.org/modules/account_statement/rev/7a83a2851a18

New changeset 47e0607c7002 by Cédric Krier in branch '3.6':
Add statement to editable line view
http://hg.tryton.org/modules/account_statement/rev/47e0607c7002
New changeset b179ef5d2a36 by Cédric Krier in branch 'default':
Add statement to editable line view
http://hg.tryton.org/modules/account_statement/rev/b179ef5d2a36
review42381002 updated at https://codereview.tryton.org/42381002/#ps1
msg33850 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-05-31.19:26:31
It should not be necessary to define a default value for a function field with a on_change_with*.
Indeed the problem is that the editable list view does not include the statement field so the client does not set it and the statement_state is not updated.
review42381002 adds the missing field.
New review41331002 at https://codereview.tryton.org/41331002/#ps1
msg33748 (view) Author: [hidden] (unicode2013) Date: 2017-05-23.10:46:18
I was not sure whether adding a default statement_state was the right way of fixing this issue.  I have submitted a review, hopefully I've done it correctly!
msg33733 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-05-22.15:19:17
@unicode2013 thanks for the suggestion but please follow http://www.tryton.org/how-to-contribute.html to contribute a patch.
msg33731 (view) Author: [hidden] (unicode2013) Date: 2017-05-22.13:53:34
Hi,

Adding a default statement_state method to the account.statement.line model seems to fix the problem for me, but I don't know if this is the proper way of fixing the problem:

diff --git a/statement.py b/statement.py
--- a/statement.py
+++ b/statement.py
@@ -595,6 +595,10 @@
             return self.statement.state

     @staticmethod
+    def default_statement_state():
+        return 'draft'
+
+    @staticmethod
     def default_amount():
         return Decimal(0)
msg33702 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-05-18.15:19:03
It's strange because I can reproduce the problem on tryton, but only when the first line is created from the tree view. If I change the view to the form view, everything works as expected. 

P.S: I'm testing on the latest trunk
msg33656 (view) Author: [hidden] (Artem) Date: 2017-05-15.12:01:27
In Statement Line only Numbers field is active. All other fields are inactive, even after saving the Statement. Tryton 4.2. in SAO client.

https://groups.google.com/forum/#!topic/tryton/jceaQzjF3_U
History
Date User Action Args
2017-06-27 12:53:15roundup-botsetmessages: + msg34279
2017-06-13 09:40:35roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg34019
2017-05-31 19:40:38reviewbotsetmessages: + msg33852
2017-05-31 19:26:31cedsetstatus: chatting -> testing
reviews: 41331002 -> 41331002,42381002
messages: + msg33850
nosy: + ced
assignedto: unicode2013 -> ced
2017-05-23 11:08:07reviewbotsetnosy: + reviewbot
messages: + msg33749
2017-05-23 11:08:06reviewbotsetreviews: 41331002
keyword: + review
2017-05-23 10:46:18unicode2013setassignedto: unicode2013
messages: + msg33748
2017-05-22 15:19:18pokolisetmessages: + msg33733
2017-05-22 13:53:34unicode2013setnosy: + unicode2013
messages: + msg33731
2017-05-18 15:19:03pokolisetstatus: unread -> chatting
nosy: + pokoli
messages: + msg33702

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