Tryton - Issues

 

Issue6507

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

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

Messages
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-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
2017-05-15 12:10:28Artemsetcomponent: + account_statement
2017-05-15 12:01:27Artemcreate

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