Browse Source

- use filtered.mapped in place of search

12.0-mig-module_prototyper_last
Giovanni 5 years ago
committed by David Beal
parent
commit
7205b17b0c
  1. 1
      attachment_synchronize/README.rst
  2. 3
      attachment_synchronize/__manifest__.py
  3. 2
      attachment_synchronize/models/task.py

1
attachment_synchronize/README.rst

@ -52,6 +52,7 @@ Contributors
* Valentin CHEMIERE <valentin.chemiere@akretion.com> * Valentin CHEMIERE <valentin.chemiere@akretion.com>
* Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com> * Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
* Florian DA COSTA <florian.dacosta@akretion.com> * Florian DA COSTA <florian.dacosta@akretion.com>
* Giovanni SERRA <giovanni@gslab.it>
Maintainer Maintainer
---------- ----------

3
attachment_synchronize/__manifest__.py

@ -1,5 +1,6 @@
# @ 2016 florian DA COSTA @ Akretion # @ 2016 florian DA COSTA @ Akretion
# © 2016 @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com> # © 2016 @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
# @ 2020 Giovanni Serra @ GSlab.it
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
@ -21,7 +22,7 @@
'security/ir.model.access.csv', 'security/ir.model.access.csv',
], ],
'demo': [ 'demo': [
# 'demo/task_demo.xml',
# 'demo/task_demo.xml',
], ],
'installable': True, 'installable': True,
'application': False, 'application': False,

2
attachment_synchronize/models/task.py

@ -172,5 +172,5 @@ class StorageTask(models.Model):
new_env.cr.commit() new_env.cr.commit()
def _file_to_import(self, filenames): def _file_to_import(self, filenames):
imported = self.attachment_ids.search([('name', 'in', [n for n in filenames])]).mapped('name')
imported = self.attachment_ids.filtered(lambda r: r.name in filenames).mapped('name')
return list(set(filenames) - set(imported)) return list(set(filenames) - set(imported))
Loading…
Cancel
Save