Tryton - Issues

 

Issue7456

Title Sao doesn't update after on_change to one2many fields
Priority bug Status need-eg
Superseder Nosy List ced, iehoshia
Type behavior Components sao
Assigned To Keywords
Reviews

Created on 2018-05-23.00:14:16 by iehoshia, last changed by ced.

Messages
msg41600 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-22.18:38:13
Do you have a traceback in the javascript console?
msg41599 (view) Author: [hidden] (iehoshia) Date: 2018-06-22.17:49:16
This doesn't work on trytond 4.6 with sao 4.6, but work with trytond 4.6 and tryton 4.6. 

On trytond 4.8 and sao 4.8 doesn't work, but work with trytond 4.8 and tryton 4.8.

I think is one javascript error on the on_change method.
msg41598 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-22.17:44:47
Again, I'm confused because you say it works with tryton 4.8 and not.
msg41597 (view) Author: [hidden] (iehoshia) Date: 2018-06-22.17:25:45
This doesn't work on trytond 4.6 and sao 4.6 niether tryton 4.8 with sao 4.8. 

It works fine with tryton 4.6 and tryton 4.8.
msg41569 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-21.11:21:12
I'm confused, you say that it works with sao 4.4 so when does it not work?
msg40949 (view) Author: [hidden] (iehoshia) Date: 2018-05-23.00:14:15
I was trying to use on_change method on one2many fields on sao, but it doesn't be updated. 

I tried to update one2many on tryton and it works fine, it works on trytond 4.4 and sao 4.4 too. 

lines = fields.One2Many('report.line',
        'report','Lines',
        )

def on_change_district(self):
    pool = Pool() 
    Group = pool.get('disc.group')

    if self.district:
        district_id = self.district.id 
        groups = Group.search([('district', '=', district_id)])
        lines  = []
        if groups: 
            for group in groups:
                Line = pool.get('report.line')
                line = Line() 
                line.group = group.id 
                line.quantity = 0 
                lines.append(line)
            self.lines = lines 
    else:
        self.lineas = []
History
Date User Action Args
2018-06-22 18:38:13cedsetmessages: + msg41600
2018-06-22 17:49:17iehoshiasetmessages: + msg41599
2018-06-22 17:44:47cedsetmessages: + msg41598
2018-06-22 17:25:45iehoshiasetmessages: + msg41597
2018-06-21 11:21:12cedsetstatus: unread -> need-eg
nosy: + ced
messages: + msg41569
2018-05-23 00:14:16iehoshiacreate

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