add row num

This commit is contained in:
ivan deng
2018-09-30 05:22:35 +08:00
parent 329a88a3e0
commit f2ae0915ea
14 changed files with 276 additions and 26 deletions

View File

@@ -34,6 +34,7 @@ http://www.sunpop.cn
## 在符合odoo开源协议的前提下去除odoo版权信息自定义你的odoo ## 在符合odoo开源协议的前提下去除odoo版权信息自定义你的odoo
可完全自行设置下列 odoo 选项,让 odoo 看上去像是你的软件产品 可完全自行设置下列 odoo 选项,让 odoo 看上去像是你的软件产品
支持odoo 12, 11, 10, 9 版本,社区版企业版通用 支持odoo 12, 11, 10, 9 版本,社区版企业版通用
1. 删除菜单导航页脚的 Odoo 标签 1. 删除菜单导航页脚的 Odoo 标签
2. 将弹出窗口中 "Odoo" 设置为自定义名称 2. 将弹出窗口中 "Odoo" 设置为自定义名称
3. 自定义用户菜单中的 Documentation, Support, About 的链接 3. 自定义用户菜单中的 Documentation, Support, About 的链接

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 292 KiB

View File

@@ -1,4 +1,4 @@
<section class="oe_container"> <section class="oe_container app">
<div class="oe_row oe_spaced" style="max-width: 95%;"> <div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_span12"> <div class="oe_span12">
<h2 class="oe_slogan">12 Ready!! App Odoo Customize</h2> <h2 class="oe_slogan">12 Ready!! App Odoo Customize</h2>
@@ -14,32 +14,35 @@
<p>Fix Login bug when install website.</p> <p>Fix Login bug when install website.</p>
<p>Add 19. One Click to clear all data (Sometime pls click twice)</p> <p>Add 19. One Click to clear all data (Sometime pls click twice)</p>
<p>Add 18. Show/Hide Author and Website in Apps Dashboard</p> <p>Add 18. Show/Hide Author and Website in Apps Dashboard</p>
<h1>More Powerful addons: <div class="row">
<a class="btn btn-primary mb16" href="http://www.odoo.com/apps/modules/browse?author=Sunpop.cn">Sunpop.cn Addons</a> <h1 class="col-md-6 text-primary">More Powerful addons:</h1>
</h1> <div class="col-md-6">
<a class="btn btn-block btn-success mt16 mb16" href="http://www.odoo.com/apps/modules/browse?author=Sunpop.cn">Sunpop.cn Awesome Odoo Addons</a>
</div>
</div>
<br> <br>
<h3>Add Odoo 11 Support</h3> <h3>Add Odoo 12, 11 Support</h3>
<ul> <ul class="list-group">
<li>1. Deletes Odoo label in footer</li> <li class="list-group-item">1. Deletes Odoo label in footer</li>
<li>2. Replaces "Odoo" in Windows title</li> <li class="list-group-item">2. Replaces "Odoo" in Windows title</li>
<li>3. Customize Documentation, Support, About links and title in usermenu</li> <li class="list-group-item">3. Customize Documentation, Support, About links and title in usermenu</li>
<li>4. Adds "Developer mode" link to the top right-hand User Menu.</li> <li class="list-group-item">4. Adds "Developer mode" link to the top right-hand User Menu.</li>
<li>5. Adds Quick Language Switcher to the top right-hand User Menu.</li> <li class="list-group-item">5. Adds Quick Language Switcher to the top right-hand User Menu.</li>
<li>6. Adds Country flags to the top right-hand User Menu.</li> <li class="list-group-item">6. Adds Country flags to the top right-hand User Menu.</li>
<li>7. Adds English and Chinese user documentation access to the top right-hand User Menu.</li> <li class="list-group-item">7. Adds English and Chinese user documentation access to the top right-hand User Menu.</li>
<li>8. Adds developer documentation access to the top right-hand User Menu.</li> <li class="list-group-item">8. Adds developer documentation access to the top right-hand User Menu.</li>
<li>9. Customize "My odoo.com account" button</li> <li class="list-group-item">9. Customize "My odoo.com account" button</li>
<li>10. Standalone setting panel, easy to setup.</li> <li class="list-group-item">10. Standalone setting panel, easy to setup.</li>
<li>11. Provide 236 country flags.</li> <li class="list-group-item">11. Provide 236 country flags.</li>
<li>12. Multi-language Support.</li> <li class="list-group-item">12. Multi-language Support.</li>
<li>13. Change Powered by Odoo in login screen.(Please change '../views/app_odoo_customize_view.xml' #15)</li> <li class="list-group-item">13. Change Powered by Odoo in login screen.(Please change '../views/app_odoo_customize_view.xml' #15)</li>
<li>14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Project/Base Models.</li> <li class="list-group-item">14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Project/Base Models.</li>
<li>15. Reset All the Sequence to beginning of 1: SO/PO/MO/Invoice...</li> <li class="list-group-item">15. Reset All the Sequence to beginning of 1: SO/PO/MO/Invoice...</li>
<li>16. Fix odoo reload module translation bug while enable english language</li> <li class="list-group-item">16. Fix odoo reload module translation bug while enable english language</li>
<li>17. Stop Odoo Auto Subscribe(Performance Improve)</li> <li class="list-group-item">17. Stop Odoo Auto Subscribe(Performance Improve)</li>
<li>18. Show/Hide Author and Website in Apps Dashboard (odoo 11 only)</li> <li class="list-group-item">18. Show/Hide Author and Website in Apps Dashboard (odoo 11 only)</li>
<li>19. One Click to clear all data (Sometime pls click twice)</li> <li class="list-group-item">19. One Click to clear all data (Sometime pls click twice)</li>
<li>20. Set System Icon (odoo 10 only)</li> <li class="list-group-item">20. Set System Icon (odoo 10 only)</li>
</ul> </ul>
<p> <p>
This module can help to white label the Odoo. This module can help to white label the Odoo.

View File

@@ -0,0 +1,5 @@
.app .list-group .list-group-item {
border: 0;
border-bottom: 1px solid #00A09D;
padding: 10px;
}

View File

@@ -3,6 +3,7 @@
<data> <data>
<template id="switch_language" name="switch_language assets" inherit_id="web.assets_backend"> <template id="switch_language" name="switch_language assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" href="/app_odoo_customize/static/src/css/index.css"/>
<link rel="stylesheet" href="/app_odoo_customize/static/src/css/app.css"/> <link rel="stylesheet" href="/app_odoo_customize/static/src/css/app.css"/>
<script type="text/javascript" src="/app_odoo_customize/static/src/js/app_window_title.js"/> <script type="text/javascript" src="/app_odoo_customize/static/src/js/app_window_title.js"/>
<script type="text/javascript" src="/app_odoo_customize/static/src/js/customize_user_menu.js"></script> <script type="text/javascript" src="/app_odoo_customize/static/src/js/customize_user_menu.js"></script>

View File

View File

@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# author: 'Nilesh Sheliya',
# Created on 2018-09-30
# author: 广州尚鹏http://www.sunpop.cn
# email: 300883@qq.com
# resource of Sunpop
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Odoo在线中文用户手册长期更新
# http://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html
# Odoo10离线中文用户手册下载
# http://www.sunpop.cn/odoo10_user_manual_document_offline/
# Odoo10离线开发手册下载-含python教程jquery参考Jinja2模板PostgresSQL参考odoo开发必备
# http://www.sunpop.cn/odoo10_developer_document_offline/
# description:
{
'name': "App Row Number in tree list view",
'version': '11.0.9.30',
'summary': 'Show row number in tree/list view. list number, list row number',
'category': 'Other',
'description': """By installing this module, user can see row number in Odoo backend tree view.""",
'author': 'Sunpop.cn',
"depends": ['web'],
'data': [
'views/listview_templates.xml',
],
"images": ["static/description/screen1.png"],
'license': 'LGPL-3',
'qweb': [
],
'installable': True,
'application': True,
'auto_install': False,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -0,0 +1,76 @@
<section class="oe_container app">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_span12">
<h2 class="oe_slogan">App Show Number in List/Tree View</h2>
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<p>You can see the row number in tree/list view in Odoo backend list views.</p>
<div class="row">
<h1 class="col-md-6 text-primary">More Powerful addons:</h1>
<div class="col-md-6">
<a class="btn btn-block btn-success mt16 mb16" href="http://www.odoo.com/apps/modules/browse?author=Sunpop.cn">Sunpop.cn Awesome Odoo Addons</a>
</div>
</div>
</div>
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Show # number in listveiw</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="s1.jpg" style="border:1px solid black"/>
</div>
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Show # number in one2many detail listveiw</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="s2.jpg" style="border:1px solid black"/>
</br>
</div>
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Show # number in grouped listveiw</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="s3.jpg" style="border:1px solid black"/>
</br>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced text-center">
<div class="oe_span12">
<h2 class="oe_slogan">Technical Help & Support</h2>
</div>
<div class="col-md-12 pad0">
<div class="oe_mt16">
<p><h4>
For any type of technical help & support requests, Feel free to contact us</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:guohuadeng@hotmail.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> guohuadeng@hotmail.com</a>
<p><h4>
Via QQ: 300883</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:300883@qq.com"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-envelope"></i> 300883@qq.com</a>
</div>
<div class="oe_mt16">
<p><h4>
Visit our website for more support.</h4></p>
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
class="btn btn-warning btn-lg" rel="nofollow" href="http://www.sunpop.cn" target="_blank"><span
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
<i class="fa fa-web"></i>http://www.sunpop.cn</a>
</div>
</div>
</div>
</section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

View File

@@ -0,0 +1,115 @@
odoo.define('app_web_list_row_number.ListNumber', function (require) {
"use strict";
var core = require('web.core');
var ListRenderer = require('web.ListRenderer');
var _t = core._t;
ListRenderer.include({
_getNumberOfCols: function () {
var columns = this._super();
columns +=1;
return columns;
},
_renderFooter: function (isGrouped) {
var $footer = this._super(isGrouped);
$footer.find("tr").prepend($('<td>'));
return $footer;
},
_renderGroupRow: function (group, groupLevel) {
var $row = this._super(group, groupLevel);
if (this.mode !== 'edit' || this.hasSelectors){
$row.find("th.o_group_name").after($('<td>'));
}
return $row;
},
_renderGroups: function (data, groupLevel) {
var self = this;
var _self = this;
groupLevel = groupLevel || 0;
var result = [];
var $tbody = $('<tbody>');
_.each(data, function (group) {
if (!$tbody) {
$tbody = $('<tbody>');
}
$tbody.append(self._renderGroupRow(group, groupLevel));
if (group.data.length) {
result.push($tbody);
// render an opened group
if (group.groupedBy.length) {
// the opened group contains subgroups
result = result.concat(self._renderGroups(group.data, groupLevel + 1));
} else {
// the opened group contains records
var $records = _.map(group.data, function (record,index) {
//Nilesh
if (_self.mode !== 'edit' || _self.hasSelectors){
return self._renderRow(record).prepend($('<th>').html(index+1)).prepend($('<td>'));
}
else{
return self._renderRow(record).prepend($('<td>'));
}
});
result.push($('<tbody>').append($records));
}
$tbody = null;
}
});
if ($tbody) {
result.push($tbody);
}
return result;
},
_renderHeader: function (isGrouped) {
var $header = this._super(isGrouped);
if (this.hasSelectors) {
$header.find("th.o_list_record_selector").before($('<th class="o_list_row_number_header">').html('#'));
var advance_search = $header.find("tr.advance_search_row")
if(advance_search.length && advance_search.find('td.o_list_row_number_header').length==0){
advance_search.prepend($('<td class="o_list_row_number_header">').html('&nbsp;'));
}
}
else{
if (this.mode !== 'edit'){
$header.find("tr").prepend($('<th>').html('#'));
}
}
//$header.find("tr").prepend($('<th>').html('#'));
return $header;
},
_renderRow: function (record) {
var $row = this._super(record);
if (this.mode !== 'edit' && this.state.groupedBy.length==0){
var index = this.state.data.findIndex(function(e){return record.id===e.id})
if (index!==-1){
$row.prepend($('<td>').html('<strong>' + (index+1).toString() +'</strong>'));
}
}
return $row;
},
/*_renderRows: function () {
var $rows = this._super();
var total_rows = $rows.length - 1;
var _self = this;
if (this.mode !== 'edit' || this.hasSelectors){
$.each($rows,function(index){
var $row = $rows[index];
if (total_rows===index && _self.addCreateLine){
$row.prepend($('<th>').html('&nbsp;'));
}
else{
$row.prepend($('<th>').html(index+1));
}
});
}
return $rows;
},*/
});
});

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="app_web_list_row_number assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/app_web_list_row_number/static/src/js/list_view.js"></script>
</xpath>
</template>
</data>
</openerp>