|
@@ -20,6 +20,8 @@ function report_invoice_utility (reporting){
|
|
|
'change #from' : 'fectSearch',
|
|
|
'change #to': 'fectSearch',
|
|
|
'click #volver_btn': 'volver',
|
|
|
+ // 'click-row.bs.table #table ' : 'ckickAnalysisDetail',
|
|
|
+ 'click-row.bs.table #table' : 'ckickAnalysisDetail',
|
|
|
},
|
|
|
init : function(parent){
|
|
|
this._super(parent);
|
|
@@ -30,6 +32,37 @@ function report_invoice_utility (reporting){
|
|
|
this.fecthFecha();
|
|
|
this.submitForm();
|
|
|
},
|
|
|
+ // Analisis Detallado
|
|
|
+ ckickAnalysisDetail: function(e, row, $element, field){
|
|
|
+
|
|
|
+ if (field == 'name'){
|
|
|
+ this.do_action({
|
|
|
+ name : "Variantes de Producto",
|
|
|
+ type : 'ir.actions.act_window',
|
|
|
+ res_model : "product.product",
|
|
|
+ views : [[false,'form']],
|
|
|
+ target : 'new',
|
|
|
+ domain : [['id','=', row.id_product]],
|
|
|
+ context : {},
|
|
|
+ flags : {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
|
|
|
+ res_id : row.id_product,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (field == 'number'){
|
|
|
+ this.do_action({
|
|
|
+ name : "Factura de Cliente",
|
|
|
+ type : 'ir.actions.act_window',
|
|
|
+ res_model : "account.invoice",
|
|
|
+ views : [[false,'form']],
|
|
|
+ target : 'new',
|
|
|
+ domain : [['type', '=', 'out_invoice'],['id','=', row.id]],
|
|
|
+ context : {},
|
|
|
+ flags : {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
|
|
|
+ res_id : row.id,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ e.stopImmediatePropagation();
|
|
|
+ },
|
|
|
// volver
|
|
|
volver: function(){
|
|
|
this.$el.find('#volver').empty();
|
|
@@ -229,7 +262,9 @@ function report_invoice_utility (reporting){
|
|
|
}
|
|
|
if (producto.type =="product"){
|
|
|
data.push({
|
|
|
+ id : invoice.id,
|
|
|
number : (invoice.number),
|
|
|
+ id_product : producto.id,
|
|
|
name : (item.name),
|
|
|
quantity : accounting.formatNumber((item.quantity),0, ".", ","),
|
|
|
price_unity : accounting.formatNumber((item.price_unit / invoice.rate),2, ".", ","),
|