Closed luisg123v closed 3 years ago
Could you share the pipeline URL where it is reproduced, please?
I can't reproduce it using the same branch.
In fact, the last pipeline the lint is green:
Check the pipeline of the MR:
If you can reproduce it again just re-open it, please
@moylop260 I was able to replicate it by:
At that point, it was replicated, but I created this MR with only the involved file.
Since I could replicate it, I'll reopen.
@luisg123v, @moylop260
According to research in same project that @luisg123v tested, the problem is that in same class where is checked lint, there is following onchange
method that set move_ids
to False (to clean it):
@api.onchange("journal_id")
def _onchange_journal_id(self):
self.move_ids = False
if not self.journal_id:
self.currency_id = False
self.move_ids = False
return {}
self.currency_id = self.journal_id.currency_id or self.company_id.currency_id
I had review and if I remove lines where move_ids is set, lint does not appear. I think that problem is how is clean move_ids
and also correct way to clean it is:
self.move_ids = [(5, )]
I think that this issue must be closed because pylint is not the problem.
cc @suniagajose
Regards.
Thanks a lot @fernandahf.
I'll close this issue..
A code like this:
for invoice in self.move_ids:
Which is perfectly valid, generates the following error:
Non-iterable value self.move_ids is used in an iterating context
It seems this lint isn't able to know that
move_ids
is an iterable, despite being an attribute (one2many field).