~luc-demeyer/openobject-addons/8.0-new-report-intrastat_small-changes

« back to all changes in this revision

Viewing changes to l10n_fr_intrastat_product/intrastat_product.py

  • Committer: Alexis de Lattre
  • Date: 2014-03-08 13:37:02 UTC
  • Revision ID: alexis@via.ecp.fr-20140308133702-3cu2m71m1kj65qu2
Only send reminder for French companies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
734
734
        if context is None:
735
735
            context = {}
736
736
        previous_month = datetime.strftime(datetime.today() + relativedelta(day=1, months=-1), '%Y-%m')
737
 
        company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)
 
737
        # I can't search on [('country_id', '=', ..)]
 
738
        # because it is a fields.function not stored and without fnct_search
 
739
        company_ids = self.pool['res.company'].search(
 
740
            cr, uid, [], context=context)
738
741
        logger.info('Starting the Intrastat Product reminder')
739
742
        for company in self.pool['res.company'].browse(cr, uid, company_ids, context=None):
 
743
            if company.country_id.code != 'FR':
 
744
                continue
740
745
            for type in ['import', 'export']:
741
746
                if type == 'import' and company.import_obligation_level == 'none':
742
747
                    continue