Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2465 Weergaven

I have overridden a method to append some new items to the dictionary of the original method. the dictionary is the third item of a tuple. I want to add new items to the dictionary. when I execute my code I have this error:

'bool' object has no attribute 'dict_one'
 

here is my code:


def action_transaction_done(self):
        res = super(ProjectTransaction, self).action_transaction_done()

        res.dict_one['branch_id'] = self.branch_id.id
        return res

and this the orginal method code:


def action_transaction_done(self):

        for action in self:
        
            for line in action.details_by_category:
            
                if self.account_id:
                    dict_one= (0, 0, {
                       'name': line.name,
                       'partner_id': line._get_partner_id(credit_account=False),
                       'account_id': self.account_id,
                       'journal_id': action.journal_id.id,
                       'date': date,
                       #to be added here
                    
                       })
                       return dict_one

how can access the dictionary from the oveeriden method and add some new items to it?


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 23
2975
1
jan. 23
2759
1
aug. 22
3423
0
aug. 22
2598
1
mrt. 22
2099