Skip to content

Commit

Permalink
[Karthi] | Fixed | Refactor. Row Number module alignment issue fixed …
Browse files Browse the repository at this point in the history
…and sale order line repected product name removed (#145)
  • Loading branch information
karthikeyansp91 authored Apr 5, 2024
1 parent c4e1087 commit a9a38d1
Show file tree
Hide file tree
Showing 38 changed files with 865 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bahmni_sale/views/sale_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<field name="lot_id" context = "{'parent_shop_id':parent.shop_id}" domain="['|',('expiration_date','&gt;', datetime.datetime.combine(context_today(), datetime.time(23,59,59))),('expiration_date','=',False),('product_qty','>' ,0),('product_id','=',product_id)]"/>
<field name="expiry_date" readonly="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="replace">
<xpath expr="//field[@name='order_line']/tree/field[@name='product_template_id']" position="replace">
<field name="product_id"
context="{'parent_shop_id':parent.shop_id,'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id}"/><!--attrs="{'readonly': ['|', ('qty_invoiced', '&gt;', 0), ('procurement_ids', '!=', [])]}"-->
</xpath>
Expand Down
15 changes: 15 additions & 0 deletions community_modules/br_custom_list_view/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Custom List View V16
====================

This module will helps to show row number, fixed header, duplicate record and highlight selected record in list view


Credits
=======
Cybrosys Techno Solutions

Author
------
* Cybrosys Techno Solutions <odoo@cybrosys.com>
Aiswarya J P @ Cybro V15
Rosmy John @ Cybro V16
Empty file.
29 changes: 29 additions & 0 deletions community_modules/br_custom_list_view/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@


{
'name': 'BR Custom List View',
'version': '16.0.1.0.1',
'summary': 'Helps to Show Row Number, Fixed Header, Duplicate Record and Highlight Selected Record in List View',
'description': 'Helps to Show Row Number, Fixed Header, Duplicate Record and Highlight Selected Record in List View',
'category': 'Tools',
'author': 'Banibro IT Solutions Pvt Ltd.',
'company': 'Banibro IT Solutions Pvt Ltd.',
'website': 'https://banibro.com',
'license': 'AGPL-3',
'email': "support@banibro.com",
'images': ['static/description/banner.png',
'static/description/icon.png',],
'depends': ['base'],
'assets': {
'web.assets_backend': [
'br_custom_list_view/static/src/js/duplicate_record.js',
'br_custom_list_view/static/src/js/record_highlight.js',
'br_custom_list_view/static/src/css/sticky_header.css',
'br_custom_list_view/static/src/css/highlight.css',
'br_custom_list_view/static/src/xml/record_highlight.xml'
],
},
'installable': True,
'auto_install': False,
'application': False,
}
5 changes: 5 additions & 0 deletions community_modules/br_custom_list_view/doc/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Module <custom_list_view>

#### 14.02.2023
#### Version 16.0.1.0.0
#### ADD Initial Commit for custom_list_view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
357 changes: 357 additions & 0 deletions community_modules/br_custom_list_view/static/description/index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

.o_list_renderer tr.o_data_row.selected_record td{
background-color: #7c7aad;
color:#ffffff
}
th[data-name="sequence"] {
width: 33px !important;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.o_list_renderer .o_list_table thead {
position: sticky;
top: 0;
z-index : 10;
}
.o_list_renderer{
height : 100%;
}
.o_list_renderer .table thead{
z-index: 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @odoo-module */
import { patch } from "@web/core/utils/patch";
import { ListController } from '@web/views/list/list_controller';

const { Component, onWillStart, useSubEnv, useEffect, useRef } = owl;

patch(ListController.prototype, "getActionMenuItems", {
async _onDuplicateSelectedRecords() {
for (var record in this.model.root.records) {
if (this.model.root.records[record].selected) {
await this.model.root.records[record].duplicate();
}
}
window.location.reload();
},

getActionMenuItems() {
const actionMenuItems = this._super.apply(this, arguments);
var self = this;
if (actionMenuItems) {
actionMenuItems.other.splice(1, 0, {
description: this.env._t("Duplicate"),
callback: (x) => {
this._onDuplicateSelectedRecords();
}
});
}
return actionMenuItems;
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @odoo-module **/
import { session } from "@web/session";
import { ListRenderer } from "@web/views/list/list_renderer";
import { patch } from "@web/core/utils/patch";
import { browser } from "@web/core/browser/browser";
import { useService } from "@web/core/utils/hooks";
const {onMounted} = owl;

patch(ListRenderer.prototype, 'br_custom_list_view/static/src/js/record_highlight.js', {
setup(){
this._super(...arguments)
onMounted(() => {
var list = $('.o_section_and_note_list_view thead').find('tr')
var elem ='<th style="min-width: 33px; width: 67px;">Sl No</th>'
list.prepend(elem)
});
},

toggleRecordSelection(record) {
var self = this;
this._super.apply(this, arguments);
var selectedRecord = $(event.target).closest('tr')
if($(event.target).prop('checked')){
selectedRecord.addClass('selected_record');
} else {
selectedRecord.removeClass('selected_record')
}
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<templates id="template" xml:space="preserve">
<t t-name="br_custom_list_view.ListRenderer" t-inherit="web.ListRenderer" t-inherit-mode="extension" owl="1">
<xpath expr="//table/thead/tr/th[@t-if='hasSelectors']" position="before">
<th>Sl No</th>
</xpath>
</t>
<t t-name="br_custom_list_view.add_number" t-inherit="web.ListRenderer.Rows" t-inherit-mode="extension" owl="1">
<xpath expr="//t[@t-foreach='list.records']" position="before">
<t t-set="RowNumber" t-value="1" />
</xpath>
<xpath expr="//t[@t-call='{{ constructor.recordRowTemplate }}']" position="after">
<t t-set="RowNumber" t-value="RowNumber+1" />
</xpath>
</t>

<t t-name="rowno_in_tree.ListRenderer.RecordRowNumber" t-inherit="web.ListRenderer.RecordRow" t-inherit-mode="extension" owl="1">
<xpath expr="//td[@class='o_list_record_selector']" position="before">
<td tabindex="-1">
<span t-esc="RowNumber" />
</td>
</xpath>
</t>
</templates>

0 comments on commit a9a38d1

Please sign in to comment.