Message 76887

Author
resteve
Date
2022-06-01.15:36:08
Message id
76887

Content

The code is a simpe "super()" and UserWarning:

    @classmethod
    def create(cls, vlist):
        Warning = Pool().get('res.user.warning')

        parties = super(Party, cls).create(vlist)
        print('create')
        print(parties)
        for party in parties:
            key = 'task_party_without_travel.%s' % party.id
            if Warning.check(key):
                raise UserWarning(key, gettext(
                        'nantic.party_without_travel', party=party.rec_name))
        return parties

When create a party, is a recursive loop of UserWarning that party id is diferent.

Logs:

24395 140059064698624 [2022-06-01 13:32:08,960] INFO trytond.wsgi <JSONRequest 44@127.0.0.1 '<http://localhost:38020/nan60nan/>' [POST] model.party.party.create>
create
[Pool().get('party.party')(10690)]
24395 140059064698624 [2022-06-01 13:32:09,201] INFO werkzeug 127.0.0.1 - - [01/Jun/2022 13:32:09] "POST /nan60nan/ HTTP/1.1" 200 -
24395 140059064698624 [2022-06-01 13:32:10,053] INFO trytond.wsgi <JSONRequest 44@127.0.0.1 '<http://localhost:38020/nan60nan/>' [POST] model.res.user.warning.create>
24395 140059064698624 [2022-06-01 13:32:10,093] INFO werkzeug 127.0.0.1 - - [01/Jun/2022 13:32:10] "POST /nan60nan/ HTTP/1.1" 200 -
24395 140059064698624 [2022-06-01 13:32:10,118] INFO trytond.wsgi <JSONRequest 44@127.0.0.1 '<http://localhost:38020/nan60nan/>' [POST] model.party.party.create>
create
[Pool().get('party.party')(10691)]
24395 140059064698624 [2022-06-01 13:32:10,418] INFO werkzeug 127.0.0.1 - - [01/Jun/2022 13:32:10] "POST /nan60nan/ HTTP/1.1" 200 -
24395 140059064698624 [2022-06-01 13:32:12,505] INFO trytond.wsgi <JSONRequest 44@127.0.0.1 '<http://localhost:38020/nan60nan/>' [POST] model.res.user.warning.create>
24395 140059064698624 [2022-06-01 13:32:12,563] INFO werkzeug 127.0.0.1 - - [01/Jun/2022 13:32:12] "POST /nan60nan/ HTTP/1.1" 200 -
24395 140059064698624 [2022-06-01 13:32:12,585] INFO trytond.wsgi <JSONRequest 44@127.0.0.1 '<http://localhost:38020/nan60nan/>' [POST] model.party.party.create>
create
[Pool().get('party.party')(10692)]
....

Detected v6.0

History
Date User Action Args
2022-06-01 15:36:08restevesetmessageid: <1654090568.922678.ATEUZ5C6SP77RSSD.issue11536@tryton.org>
2022-06-01 15:36:08restevelinkissue11536 messages
2022-06-01 15:36:08restevecreate

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