Просмотр исходного кода

[FIX] correciones en la vista de detalles

Rodney Enciso Arias 7 лет назад
Родитель
Сommit
98a2f6c437
2 измененных файлов с 12 добавлено и 6 удалено
  1. 2 2
      static/src/js/reports/report_balance.js
  2. 10 4
      static/src/js/reports/report_works.js

+ 2 - 2
static/src/js/reports/report_balance.js

@@ -36,9 +36,9 @@ function report_balance (reporting){
         ckickAnalysisDetail: function(e, row, $element,field){
             if (field == 'number'){
                 this.do_action({
-                    name:"Registro del Cliente",
+                    name:"Factura",
                     type: 'ir.actions.act_window',
-                    res_model: "res.partner",
+                    res_model: "account.invoice",
                     views: [[false,'form']],
                     target: 'new',
                     domain: [['id','=', row.id]],

+ 10 - 4
static/src/js/reports/report_works.js

@@ -34,17 +34,17 @@ function report_works (reporting){
         },
         // Analisis Detallado
         ckickAnalysisDetail: function(e, row, $element,field){
-            if (field == 'number'){
+            if (field == 'customer'){
                 this.do_action({
                     name:"Registro del Cliente",
                     type: 'ir.actions.act_window',
                     res_model: "res.partner",
                     views: [[false,'form']],
                     target: 'new',
-                    domain: [['id','=', row.id]],
+                    domain: [['id','=', row.customer_id]],
                     context: {},
                     flags: {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
-                    res_id: row.id,
+                    res_id: row.customer_id,
                 });
             }
             e.stopImmediatePropagation();
@@ -211,6 +211,7 @@ function report_works (reporting){
             var state;
             var data = [];
             var car;
+            var agente;
             _.each(CarCar, function(item){
                 task = self.getCarWorkShop(item.id);
                 car = self.getCarService(item.name[0])
@@ -234,13 +235,18 @@ function report_works (reporting){
                     state = 'No Facturado';
                 } else {
                     state = 'Facturado';
+                }
+                if (item.agent_id.length == undefined) {
+                    agente = 'Particular';
+                }else{
+                    agente = item.agent_id[1];
                 }      
                 data.push({
                     id : item.id,
                     customer_id : item.partner_id[0],
                     customer : item.partner_id[1],
                     car : item.name[1],
-                    agent : self.valorNull(item.agent_id[1]),
+                    agent : agente,
                     date_in : moment(item.date_in).format("DD/MM/YYYY"),
                     date : item.date_in,
                     secure_amount : accounting.formatNumber(secure_amount,0,".",","),