~jfb-tempo-consulting/unifield-web/us-1673

« back to all changes in this revision

Viewing changes to addons/openerp/static/javascript/listgrid.js

  • Committer: jf
  • Date: 2016-05-26 10:12:49 UTC
  • mfrom: (4788.1.1 unifield-web)
  • Revision ID: jfb@tempo-consulting.fr-20160526101249-xgzdlcx2mahllzij
US-1290 [FIX] JI / JE standard export: exclude Initial Balance entries

lp:~julie-w/unifield-web/US-1290

Show diffs side-by-side

added added

removed removed

Lines of Context:
1069
1069
        }
1070
1070
        ids = '[' + ids.join(',') + ']';
1071
1071
        var search_data_field = openobject.dom.get('_terp_search_data')
 
1072
 
 
1073
        // (US-1290) JI and JE export: always exclude Initial Balance entries
 
1074
        var domain = openobject.dom.get('_terp_search_domain').value;
 
1075
        if(this.model == 'account.move.line' || this.model == 'account.move') {
 
1076
            if(domain != "None") {
 
1077
                domain = domain.substring(0, domain.length-1);  // remove the last "]"
 
1078
                domain += ", ('period_id.number', '>', 0), ]";
 
1079
            }
 
1080
            else {
 
1081
                domain = "[('period_id.number', '>', 0), ]";
 
1082
            }
 
1083
        }
 
1084
 
1072
1085
        jQuery.frame_dialog({src:openobject.http.getURL('/openerp/impex/exp', {
1073
1086
            _terp_model: this.model,
1074
1087
            _terp_source: this.name,
1075
1088
            _terp_context: openobject.dom.get('_terp_context').value,
1076
 
            _terp_search_domain: openobject.dom.get('_terp_search_domain').value,
 
1089
            _terp_search_domain: domain,
1077
1090
            _terp_search_data: search_data_field && search_data_field.value || '',
1078
1091
            _terp_ids: ids,
1079
1092
            _terp_view_ids : this.view_ids,