Forráskód Böngészése

[ADD] Informe general de stock e informe de cuotas vencidas

Rodney Enciso Arias 7 éve
szülő
commit
1356e9f0ab

+ 1 - 1
static/src/js/configuration_reporting.js

@@ -46,7 +46,7 @@ function configuration_reporting (instance, widget) {
                 action: 'ReportExpired'
             },
             {
-                title: 'Listado General de Stock',
+                title: 'Informe General de Stock',
                 description: 'Permite visualizar todos los productos en el stock',
                 action: 'ReportStockGral'
             }

+ 24 - 5
static/src/js/reports/report_stock_gral.js

@@ -19,6 +19,7 @@ function report_stock_gral (reporting){
             'change #current-location': 'fecthSearch',
             'change #current-category' : 'fecthSearch',
             'change #current-brand' : 'fecthSearch',
+            'click-row.bs.table #table ' : 'ckickAnalysisDetail',
         },
         init : function(parent){
             this._super(parent);
@@ -30,6 +31,23 @@ function report_stock_gral (reporting){
             table.bootstrapTable({data : self.productProduct});
             self.fecthInitial();
         },
+        ckickAnalysisDetail: function(e, row, $element,field){
+            console.log(row);
+            if (field == 'product'){
+                this.do_action({
+                    name:"Producto",
+                    type: 'ir.actions.act_window',
+                    res_model: "product.product",
+                    views: [[false,'form']],
+                    target: 'new',
+                    domain: [['id', '=',row.id ]],
+                    context: {},
+                    flags: {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
+                    res_id: row.id,
+                });
+            }
+            e.stopImmediatePropagation();
+        },
         fecthInitial: function(){
             var self = this;
             self.fecthLocation().then(function(stockLocation){
@@ -256,11 +274,12 @@ function report_stock_gral (reporting){
                             quant=itemQuant.shift();
                             valuation = itemProduct.standard_price * cat
                             stock.push({
-                                    factory_reference : itemProduct.factory_reference,
+                                    id : quant.product_id[0], 
+                                    factory_reference : self.valorNull(itemProduct.factory_reference),
                                     product : quant.product_id[1],
                                     qty : cat,
                                     brand_id : itemProduct.product_brand_id[0],
-                                    brand : itemProduct.product_brand_id[1],
+                                    brand : self.valorNull(itemProduct.product_brand_id[1]),
                                     category_id : itemProduct.categ_id[0],
                                     category : itemProduct.categ_id[1],
                                     standard_price : accounting.formatNumber(itemProduct.standard_price,2, ".", ","),
@@ -411,9 +430,9 @@ function report_stock_gral (reporting){
                     factory_reference : {columnWidth: '5px'},
                     product : {columnWidth: '5px'},
                     brand : {columnWidth: '5px'},
-                    qty : {align:'center', columnWidth: '3px'},
-                    standard_price : {halign:'right',columnWidth: '5px'},
-                    valuation : {halign:'right',columnWidth: '8px'},
+                    qty : {align:'center', columnWidth: 'auto'},
+                    standard_price : {halign:'right',columnWidth: 'auto'},
+                    valuation : {halign:'right',columnWidth: 'auto'},
                 },
                 margin: { top: 20, horizontal: 7},
 

+ 4 - 4
static/src/reports/report_stock_gral.xml

@@ -3,7 +3,7 @@
         <t t-name="ReportStockGral">
             <div class="report_view">
                 <div class="reporting_page_header">
-                    <h1>Listado de Stock Detallado</h1>
+                    <h1>Informe General de Stock</h1>
                 </div>
                 <table class="table table-condensed">
                     <tbody>
@@ -37,7 +37,7 @@
                         </tr>
                     </tbody>
                 </table>
-                <table id="table"
+                <table id="table" class="table_paint_first_row"
                        data-pagination="true"
                        data-toggle="table"
                        data-reorderable-columns="true"
@@ -48,10 +48,10 @@
                        data-classes="table table-hover table-condensed"
                        data-row-style="rowStyle"
                        data-search="true">
-                    <thead>
+                    <thead class="table_header">
                         <tr>
-                            <th data-field="factory_reference" data-sortable="true" >Referencia</th>
                             <th data-field="product" data-sortable="true" >Productos</th>
+                            <th data-field="factory_reference" data-sortable="true" >Referencia</th>
                             <th data-field="brand" data-sortable="true" >Marca</th>
                             <!-- <th data-field="category" data-sortable="true" >Categoria</th> -->
                             <th data-field="qty" data-sortable="true" data-align="center">Cantidad</th>