条码增加可定制功能

fix odoo customize
This commit is contained in:
ivan deng
2018-01-15 21:38:18 +08:00
parent e883015416
commit 033d517c03
15 changed files with 236 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ class AppThemeConfigSettings(models.TransientModel):
@api.model @api.model
def get_default_all(self, fields): def get_default_all(self, fields):
ir_config = self.env['ir.config_parameter'] ir_config = self.env['ir.config_parameter']
app_system_name = ir_config.get_param('app.window_title', default='odooApp') app_system_name = ir_config.get_param('app_system_name', default='odooApp')
app_show_lang = True if ir_config.get_param('app_show_lang') == "True" else False app_show_lang = True if ir_config.get_param('app_show_lang') == "True" else False
app_show_debug = True if ir_config.get_param('app_show_debug') == "True" else False app_show_debug = True if ir_config.get_param('app_show_debug') == "True" else False
@@ -283,7 +283,6 @@ class AppThemeConfigSettings(models.TransientModel):
['stock.move', ], ['stock.move', ],
['stock.pack.operation', ], ['stock.pack.operation', ],
['stock.picking', ], ['stock.picking', ],
['stock.picking.wave', ],
['stock.scrap', ], ['stock.scrap', ],
['stock.inventory.line', ], ['stock.inventory.line', ],
['stock.inventory', ], ['stock.inventory', ],
@@ -303,9 +302,9 @@ class AppThemeConfigSettings(models.TransientModel):
'|', ('code', '=', 'stock.lot.tracking'), '|', ('code', '=', 'stock.lot.tracking'),
'|', ('code', '=', 'stock.orderpoint'), '|', ('code', '=', 'stock.orderpoint'),
'|', ('code', '=', 'stock.picking'), '|', ('code', '=', 'stock.picking'),
'|', ('code', '=', 'picking.wave'),
'|', ('code', '=', 'stock.quant.package'), '|', ('code', '=', 'stock.quant.package'),
'|', ('code', '=', 'stock.scrap'), '|', ('code', '=', 'stock.scrap'),
'|', ('code', '=', 'stock.picking'),
'|', ('prefix', '=', 'WH/IN/'), '|', ('prefix', '=', 'WH/IN/'),
'|', ('prefix', '=', 'WH/INT/'), '|', ('prefix', '=', 'WH/INT/'),
'|', ('prefix', '=', 'WH/OUT/'), '|', ('prefix', '=', 'WH/OUT/'),
@@ -325,7 +324,6 @@ class AppThemeConfigSettings(models.TransientModel):
"or code ='stock.quant.package'" \ "or code ='stock.quant.package'" \
"or code ='stock.scrap'" \ "or code ='stock.scrap'" \
"or code ='stock.picking'" \ "or code ='stock.picking'" \
"or code ='picking.wave'" \
"or prefix ='WH/IN/'" \ "or prefix ='WH/IN/'" \
"or prefix ='WH/INT/'" \ "or prefix ='WH/INT/'" \
"or prefix ='WH/OUT/'" \ "or prefix ='WH/OUT/'" \

View File

@@ -1,3 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Jarvis (www.odoomod.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

View File

@@ -5,6 +5,9 @@
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;"> <div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<p>This moduld allows user to quickly customize and debranding Odoo. Quick debug, Language Switcher, <p>This moduld allows user to quickly customize and debranding Odoo. Quick debug, Language Switcher,
Online Documentation Access,Quick Data Clear. </p> Online Documentation Access,Quick Data Clear. </p>
<h1>More Powerful UI addons:
<a class="btn btn-primary mb16" href="https://www.odoo.com/apps/modules/10.0/app_ui_enhance/">【App UI enhance】</a>
</h1>
<br> <br>
<ul> <ul>
<li>1. Deletes Odoo label in footer</li> <li>1. Deletes Odoo label in footer</li>

View File

@@ -15,14 +15,19 @@
# http://www.sunpop.cn/odoo10_developer_document_offline/ # http://www.sunpop.cn/odoo10_developer_document_offline/
# description: # description:
{ {
'name': 'App Web UI Enhance', 'name': 'App Web UI Enhance(Search by date or number range,List background color,Barcode Setting.)',
'version': '10.0.1.0', 'version': '10.0.1.0',
'author': 'Sunpop.cn', 'author': 'Sunpop.cn',
'category': 'web', 'category': 'web',
'website': 'http://www.sunpop.cn', 'website': 'http://www.sunpop.cn',
'license': 'AGPL-3', 'license': 'AGPL-3',
'sequence': 2, 'sequence': 2,
'summary': 'UI Enhance for Odoo. 1.Search by date or number range in List view and Pivot view. 2.Instructions for Activating List background color property', 'summary': """
UI Enhance for Odoo.
1.Search by date or number range in List view and Pivot view.
2.Instructions for Activating List background color property.
3.Reset the barcode format.
""",
'description': """ 'description': """
1.Search by date or number range in List view and Pivot view 1.Search by date or number range in List view and Pivot view
@@ -49,7 +54,7 @@ eg.
-------------------------------------------------- --------------------------------------------------
""", """,
'depends': ['web','app_odoo_customize'], 'depends': ['web', 'app_odoo_customize'],
'data': [ 'data': [
'views/app_ui_config_settings_view.xml', 'views/app_ui_config_settings_view.xml',
'views/template_view.xml', 'views/template_view.xml',
@@ -61,7 +66,7 @@ eg.
], ],
"price": 68.00, "price": 68.00,
"currency": "EUR", "currency": "EUR",
'images': ['static/description/list_pivot.png'], 'images': ['static/description/list_pivot.png'],
'installable': True, 'installable': True,

View File

@@ -9,5 +9,9 @@
<field name="key">app_ui_show_search_number</field> <field name="key">app_ui_show_search_number</field>
<field name="value">False</field> <field name="value">False</field>
</record> </record>
<record id="app_ui_force_barcode" model="ir.config_parameter">
<field name="key">app_ui_force_barcode</field>
<field name="value">Code128</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@@ -6,10 +6,10 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0+e-20171107\n" "Project-Id-Version: Odoo Server 10.0+e-20171107\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-16 09:24+0000\n" "POT-Creation-Date: 2018-01-15 13:31+0000\n"
"PO-Revision-Date: 2017-11-16 09:24+0000\n" "PO-Revision-Date: 2018-01-15 13:31+0000\n"
"Last-Translator: <300883@qq.com>" "Last-Translator: <>\n"
"Language-Team: Sunpop.cn" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
@@ -38,6 +38,21 @@ msgstr "应用"
msgid "Cancel" msgid "Cancel"
msgstr "取消" msgstr "取消"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Codabar"
msgstr "Codabar"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Code11"
msgstr "Code11"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Code128"
msgstr "Code128"
#. module: app_ui_enhance #. module: app_ui_enhance
#: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_create_uid #: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_create_uid
msgid "Created by" msgid "Created by"
@@ -53,6 +68,16 @@ msgstr "创建时间"
msgid "Display Name" msgid "Display Name"
msgstr "显示名称" msgstr "显示名称"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "EAN13"
msgstr "EAN13"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "EAN8"
msgstr "EAN8"
#. module: app_ui_enhance #. module: app_ui_enhance
#. openerp-web #. openerp-web
#: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:22 #: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:22
@@ -60,6 +85,26 @@ msgstr "显示名称"
msgid "End date" msgid "End date"
msgstr "结束日期" msgstr "结束日期"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Extended39"
msgstr "Extended39"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Extended93"
msgstr "Extended93"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "FIM"
msgstr "FIM"
#. module: app_ui_enhance
#: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_app_ui_force_barcode
msgid "Force all Odoo Barcode to:"
msgstr "强制设置所有Odoo条码格式:"
#. module: app_ui_enhance #. module: app_ui_enhance
#. openerp-web #. openerp-web
#: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:43 #: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:43
@@ -67,6 +112,11 @@ msgstr "结束日期"
msgid "From" msgid "From"
msgstr "从" msgstr "从"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "I2of5"
msgstr "I2of5"
#. module: app_ui_enhance #. module: app_ui_enhance
#: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_id #: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_id
msgid "ID" msgid "ID"
@@ -92,6 +142,21 @@ msgstr "最后更新人"
msgid "Last Updated on" msgid "Last Updated on"
msgstr "最后更新时间" msgstr "最后更新时间"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "MSI"
msgstr "MSI"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Odoo Default"
msgstr "Odoo 默认"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "POSTNET"
msgstr "POSTNET"
#. module: app_ui_enhance #. module: app_ui_enhance
#. openerp-web #. openerp-web
#: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:18 #: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:18
@@ -102,6 +167,21 @@ msgstr "最后更新时间"
msgid "Press Enter to search" msgid "Press Enter to search"
msgstr "直接按回车即可搜索" msgstr "直接按回车即可搜索"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "QR"
msgstr "QR"
#. module: app_ui_enhance
#: model:ir.model,name:app_ui_enhance.model_report
msgid "Report"
msgstr "报表"
#. module: app_ui_enhance
#: model:ir.ui.view,arch_db:app_ui_enhance.view_app_ui_config_settings
msgid "Report Setting"
msgstr "Report Setting"
#. module: app_ui_enhance #. module: app_ui_enhance
#: model:ir.ui.view,arch_db:app_ui_enhance.view_app_ui_config_settings #: model:ir.ui.view,arch_db:app_ui_enhance.view_app_ui_config_settings
msgid "Search Enhance" msgid "Search Enhance"
@@ -113,6 +193,11 @@ msgstr "搜索增加"
msgid "Set 'True' to show, Set 'False' to hide" msgid "Set 'True' to show, Set 'False' to hide"
msgstr "设为 'True' 则显示,设为 'False' 则隐藏" msgstr "设为 'True' 则显示,设为 'False' 则隐藏"
#. module: app_ui_enhance
#: model:ir.model.fields,help:app_ui_enhance.field_app_ui_config_settings_app_ui_force_barcode
msgid "Set Odoo Default to use the barcode odoo define in report(EAN13)."
msgstr "设置为'Odoo默认'即使用代码中设置的条码编码(EAN13)"
#. module: app_ui_enhance #. module: app_ui_enhance
#: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_app_ui_show_search_date #: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_app_ui_show_search_date
msgid "Show date range search in tree/pivot view" msgid "Show date range search in tree/pivot view"
@@ -123,6 +208,16 @@ msgstr "显示日期搜索在tree/pivot视图生效"
msgid "Show number range search tree/pivot view" msgid "Show number range search tree/pivot view"
msgstr "显示数值搜索在tree/pivot视图生效" msgstr "显示数值搜索在tree/pivot视图生效"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Standard39"
msgstr "Standard39"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "Standard93"
msgstr "Standard93"
#. module: app_ui_enhance #. module: app_ui_enhance
#. openerp-web #. openerp-web
#: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:18 #: code:addons/app_ui_enhance/static/src/xml/pivot_view.xml:18
@@ -143,6 +238,16 @@ msgstr "至"
msgid "UI Enhance" msgid "UI Enhance"
msgstr "界面增强" msgstr "界面增强"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "UPCA"
msgstr "UPCA"
#. module: app_ui_enhance
#: selection:app.ui.config.settings,app_ui_force_barcode:0
msgid "USPS_4State"
msgstr "USPS_4State"
#. module: app_ui_enhance #. module: app_ui_enhance
#: model:ir.ui.view,arch_db:app_ui_enhance.view_app_ui_config_settings #: model:ir.ui.view,arch_db:app_ui_enhance.view_app_ui_config_settings
msgid "odoo UI Enhance" msgid "odoo UI Enhance"

View File

@@ -1,2 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import app_ui_config_settings import app_ui_config_settings
import report

View File

@@ -30,15 +30,50 @@ class AppUiConfigSettings(models.TransientModel):
app_ui_show_search_date = fields.Boolean('Show date range search in tree/pivot view', help=u"Set 'True' to show, Set 'False' to hide") app_ui_show_search_date = fields.Boolean('Show date range search in tree/pivot view', help=u"Set 'True' to show, Set 'False' to hide")
app_ui_show_search_number = fields.Boolean('Show number range search tree/pivot view', help=u"Set 'True' to show, Set 'False' to hide") app_ui_show_search_number = fields.Boolean('Show number range search tree/pivot view', help=u"Set 'True' to show, Set 'False' to hide")
"""Contoller able to render barcode images thanks to reportlab.
Samples:
<img t-att-src="'/report/barcode/QR/%s' % o.name"/>
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' %
('QR', o.name, 200, 200)"/>
:param type: Accepted types: 'Codabar', 'Code11', 'Code128', 'EAN13', 'EAN8', 'Extended39',
'Extended93', 'FIM', 'I2of5', 'MSI', 'POSTNET', 'QR', 'Standard39', 'Standard93',
'UPCA', 'USPS_4State'
:param humanreadable: Accepted values: 0 (default) or 1. 1 will insert the readable value
at the bottom of the output image
"""
app_ui_force_barcode = fields.Selection([
('Default', 'Odoo Default'),
('Code128', 'Code128'),
('Standard39', 'Standard39'),
('EAN13', 'EAN13'),
('QR', 'QR'),
('Codabar', 'Codabar'),
('Code11', 'Code11'),
('Extended39', 'Extended39'),
('EAN8', 'EAN8'),
('Extended93', 'Extended93'),
('FIM', 'FIM'),
('I2of5', 'I2of5'),
('MSI', 'MSI'),
('POSTNET', 'POSTNET'),
('Standard93', 'Standard93'),
('UPCA', 'UPCA'),
('USPS_4State', 'USPS_4State'),
], string='Force all Odoo Barcode to:', help=u"Set Odoo Default to use the barcode odoo define in report(EAN13).")
@api.model @api.model
def get_default_all(self, fields): def get_default_all(self, fields):
ir_config = self.env['ir.config_parameter'] ir_config = self.env['ir.config_parameter']
app_ui_show_search_date = True if ir_config.get_param('app_ui_show_search_date') == "True" else False app_ui_show_search_date = True if ir_config.get_param('app_ui_show_search_date') == "True" else False
app_ui_show_search_number = True if ir_config.get_param('app_ui_show_search_number') == "True" else False app_ui_show_search_number = True if ir_config.get_param('app_ui_show_search_number') == "True" else False
app_ui_force_barcode = ir_config.get_param('app_ui_force_barcode')
return dict( return dict(
app_ui_show_search_date=app_ui_show_search_date, app_ui_show_search_date=app_ui_show_search_date,
app_ui_show_search_number=app_ui_show_search_number app_ui_show_search_number=app_ui_show_search_number,
app_ui_force_barcode=app_ui_force_barcode
) )
@api.multi @api.multi
@@ -47,4 +82,5 @@ class AppUiConfigSettings(models.TransientModel):
ir_config = self.env['ir.config_parameter'] ir_config = self.env['ir.config_parameter']
ir_config.set_param("app_ui_show_search_date", self.app_ui_show_search_date or "False") ir_config.set_param("app_ui_show_search_date", self.app_ui_show_search_date or "False")
ir_config.set_param("app_ui_show_search_number", self.app_ui_show_search_number or "False") ir_config.set_param("app_ui_show_search_number", self.app_ui_show_search_number or "False")
ir_config.set_param("app_ui_force_barcode", self.app_ui_force_barcode or "Default")
return True return True

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from odoo import api, models, fields, _
from odoo.addons import decimal_precision as dp
from odoo.exceptions import UserError, ValidationError
class Report(models.Model):
_inherit = 'report'
"""Contoller able to render barcode images thanks to reportlab.
Samples:
<img t-att-src="'/report/barcode/QR/%s' % o.name"/>
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' %
('QR', o.name, 200, 200)"/>
:param type: Accepted types: 'Codabar', 'Code11', 'Code128', 'EAN13', 'EAN8', 'Extended39',
'Extended93', 'FIM', 'I2of5', 'MSI', 'POSTNET', 'QR', 'Standard39', 'Standard93',
'UPCA', 'USPS_4State'
:param humanreadable: Accepted values: 0 (default) or 1. 1 will insert the readable value
at the bottom of the output image
"""
def barcode(self, barcode_type, value, width=600, height=100, humanreadable=0):
ir_config = self.env['ir.config_parameter']
app_ui_force_barcode = ir_config.get_param('app_ui_force_barcode', default='Default')
if app_ui_force_barcode or app_ui_force_barcode == 'Default':
return super(Report, self).barcode(barcode_type, value, width, height, humanreadable)
else:
return super(Report, self).barcode(app_ui_force_barcode, value, width, height, humanreadable)

View File

@@ -12,6 +12,11 @@
<li>3.Auto get user timezone, global Timezone supported.</li> <li>3.Auto get user timezone, global Timezone supported.</li>
<li>4.Easy admin to enable/disable the search.</li> <li>4.Easy admin to enable/disable the search.</li>
</ul> </ul>
<br>
<ul>
<li>5.Instructions for Activating List background color property. </li>
<li>6.Reset the barcode format.</li>
</ul>
</div> </div>
</div> </div>
</div> </div>
@@ -49,7 +54,7 @@
<h4> There are 2 way to setup</h4> <h4> There are 2 way to setup</h4>
<p>1.Go to Menu: Settings->odooApp->UI Enhance</p> <p>1.Go to Menu: Settings->odooApp->UI Enhance</p>
<p>Setup whate you need</p> <p>Setup what you need</p>
<div class="oe_demo oe_picture oe_screenshot"> <div class="oe_demo oe_picture oe_screenshot">
<img src="setup1.jpg"> <img src="setup1.jpg">
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

@@ -8,4 +8,36 @@
left: 6px; left: 6px;
top: 3px; top: 3px;
content: ""; content: "";
}
/*
强制表格滚动,企业版中生效
*/
.force_scroll .table-responsive {
white-space: nowrap !important;
overflow: hidden !important;
overflow-x: auto !important;
}
.force_scroll ::-webkit-scrollbar {
height: 16px!important;
}
/* 滚动条的滑轨背景颜色 */
.force_scroll ::-webkit-scrollbar-track {
background-color: lightgrey!important;;
-webkit-border-radius: 2em !important;;
-moz-border-radius: 2em !important;;
border-radius: 2em !important;;
}
/* 滑块颜色 */
.force_scroll ::-webkit-scrollbar-thumb {
background-color: #666666 !important;;
-webkit-border-radius: 2em !important;;
-moz-border-radius: 2em !important;;
border-radius: 2em !important;;
}
/* 横向滚动条和纵向滚动条相交处尖角的颜色 */
.force_scroll ::-webkit-scrollbar-corner {
background-color: black;
} }

View File

@@ -25,6 +25,9 @@
</div> </div>
</div> </div>
</group> </group>
<group string="Report Setting">
<field name="app_ui_force_barcode"/>
</group>
</form> </form>
</field> </field>
</record> </record>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data> <data>
<template id="assets_backend" inherit_id="web.assets_backend"> <template id="assets_backend" name="app_ui_enhance asset" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" type="text/css" href="/app_ui_enhance/static/src/css/app_ui_enhance.css"/> <link rel="stylesheet" type="text/css" href="/app_ui_enhance/static/src/css/app_ui_enhance.css"/>
<link rel="stylesheet" href="/app_ui_enhance/static/src/css/web_list_bg_color.css"/> <link rel="stylesheet" href="/app_ui_enhance/static/src/css/web_list_bg_color.css"/>