[FIX] point_of_sale: correctly load new partners when there were none before, and only reload customers.

This commit is contained in:
Frédéric van der Essen
2015-03-06 15:16:12 +01:00
parent 448c431829
commit 102a5392c9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ openerp.point_of_sale.load_db = function load_db(instance, module){
return updated_count;
},
get_partner_write_date: function(){
return this.partner_write_date;
return this.partner_write_date || "1970-01-01 00:00:00";
},
get_partner_by_id: function(id){
return this.partner_by_id[id];
+1 -1
View File
@@ -480,7 +480,7 @@ openerp.point_of_sale.load_models = function load_models(instance, module){ //mo
var fields = _.find(this.models,function(model){ return model.model === 'res.partner'; }).fields;
new instance.web.Model('res.partner')
.query(fields)
.filter([['write_date','>',this.db.get_partner_write_date()]])
.filter([['customer','=',true],['write_date','>',this.db.get_partner_write_date()]])
.all({'timeout':3000, 'shadow': true})
.then(function(partners){
if (self.db.add_partners(partners)) { // check if the partners we got were real updates