Skip to content

Commit

Permalink
[ADD] enable the use of the same file by several configuration (naive
Browse files Browse the repository at this point in the history
implementation of issue #52)
  • Loading branch information
xtof-osd committed Jul 9, 2018
1 parent 468e61d commit 45b23bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion goufi_base/models/import_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ def action_open_tabs_view(self):
# file detection

def detect_files(self, cr=None, uid=None, context=None, cur_dir=None):
self.ensure_one()

file_model = self.env['goufi.import_file']
delete_files_val = self.env['ir.config_parameter'].get_param('goufi.delete_obsolete_files')
delete_files = True if delete_files_val == 'True' else False
Expand Down Expand Up @@ -206,7 +208,7 @@ def detect_files(self, cr=None, uid=None, context=None, cur_dir=None):
filesize = os.path.getsize(cur_path)
str_date = dateToOdooString(datetime.now())

existing_found = file_model.search([('filename', '=', cur_path)])
existing_found = file_model.search([('filename', '=', cur_path), ('import_config', '=', self.id)])
nb_found = len(existing_found)

if nb_found == 1:
Expand Down

0 comments on commit 45b23bb

Please sign in to comment.