update app_ui, allow barcode

This commit is contained in:
ivan deng
2018-01-29 03:14:50 +08:00
parent 3170673594
commit e64f6c3e4b
8 changed files with 47 additions and 8 deletions

View File

@@ -17,8 +17,8 @@
{ {
'name': 'App Web UI Enhance(Search by date or number range,List background color,Barcode Setting.)', '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',
'category': 'web', 'category': 'web',
'author': 'Sunpop.cn',
'website': 'http://www.sunpop.cn', 'website': 'http://www.sunpop.cn',
'license': 'AGPL-3', 'license': 'AGPL-3',
'sequence': 2, 'sequence': 2,

View File

@@ -13,5 +13,10 @@
<field name="key">app_ui_force_barcode</field> <field name="key">app_ui_force_barcode</field>
<field name="value">Code128</field> <field name="value">Code128</field>
</record> </record>
<!--默认允许QRCode39-->
<record id="app_ui_allow_barcode" model="ir.config_parameter">
<field name="key">app_ui_allow_barcode</field>
<field name="value">QR,Standard39</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@@ -6,8 +6,8 @@ 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: 2018-01-15 13:31+0000\n" "POT-Creation-Date: 2018-01-28 19:12+0000\n"
"PO-Revision-Date: 2018-01-15 13:31+0000\n" "PO-Revision-Date: 2018-01-28 19:12+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -23,6 +23,11 @@ msgstr ""
msgid "All" msgid "All"
msgstr "全部" msgstr "全部"
#. module: app_ui_enhance
#: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_app_ui_allow_barcode
msgid "Allow Barcode, Seperated by \",\""
msgstr "允许的条码,用\",\"分隔"
#. module: app_ui_enhance #. module: app_ui_enhance
#: model:ir.model,name:app_ui_enhance.model_app_ui_config_settings #: model:ir.model,name:app_ui_enhance.model_app_ui_config_settings
msgid "App Web UI enhance settings" msgid "App Web UI enhance settings"
@@ -63,6 +68,11 @@ msgstr "创建人"
msgid "Created on" msgid "Created on"
msgstr "创建时间" msgstr "创建时间"
#. module: app_ui_enhance
#: model:ir.model.fields,help:app_ui_enhance.field_app_ui_config_settings_app_ui_allow_barcode
msgid "Default Allow QR and Standard39."
msgstr "建议默认输入 QR,Standard39"
#. module: app_ui_enhance #. module: app_ui_enhance
#: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_display_name #: model:ir.model.fields,field_description:app_ui_enhance.field_app_ui_config_settings_display_name
msgid "Display Name" msgid "Display Name"

View File

@@ -63,17 +63,21 @@ class AppUiConfigSettings(models.TransientModel):
('USPS_4State', 'USPS_4State'), ('USPS_4State', 'USPS_4State'),
], string='Force all Odoo Barcode to:', help=u"Set Odoo Default to use the barcode odoo define in report(EAN13).") ], string='Force all Odoo Barcode to:', help=u"Set Odoo Default to use the barcode odoo define in report(EAN13).")
app_ui_allow_barcode = fields.Char('Allow Barcode, Seperated by ","', help=u"Default Allow QR and Standard39.")
@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') app_ui_force_barcode = ir_config.get_param('app_ui_force_barcode')
app_ui_allow_barcode = ir_config.get_param('app_ui_allow_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 app_ui_force_barcode=app_ui_force_barcode,
app_ui_allow_barcode=app_ui_allow_barcode
) )
@api.multi @api.multi
@@ -83,4 +87,5 @@ class AppUiConfigSettings(models.TransientModel):
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") ir_config.set_param("app_ui_force_barcode", self.app_ui_force_barcode or "Default")
ir_config.set_param("app_ui_allow_barcode", self.app_ui_allow_barcode or "")
return True return True

View File

@@ -23,7 +23,13 @@ class Report(models.Model):
def barcode(self, barcode_type, value, width=600, height=100, humanreadable=0): def barcode(self, barcode_type, value, width=600, height=100, humanreadable=0):
ir_config = self.env['ir.config_parameter'] ir_config = self.env['ir.config_parameter']
app_ui_force_barcode = ir_config.get_param('app_ui_force_barcode', default='Default') 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': app_ui_allow_barcode = ir_config.get_param('app_ui_allow_barcode', default='')
allow = app_ui_allow_barcode.strip(',').split(',')
allowtype = tuple(allow)
if not app_ui_force_barcode or app_ui_force_barcode == 'Default':
return super(Report, self).barcode(barcode_type, value, width, height, humanreadable)
# 在允许的例外列表内
elif barcode_type in allowtype:
return super(Report, self).barcode(barcode_type, value, width, height, humanreadable) return super(Report, self).barcode(barcode_type, value, width, height, humanreadable)
else: else:
return super(Report, self).barcode(app_ui_force_barcode, value, width, height, humanreadable) return super(Report, self).barcode(app_ui_force_barcode, value, width, height, humanreadable)

View File

@@ -1,7 +1,7 @@
<section class="oe_container"> <section class="oe_container">
<div class="oe_row oe_spaced" style="max-width: 800px;"> <div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_span12"> <div class="oe_span12">
<h2 class="oe_slogan">App Web UI Enhance(Search by date or number range,List background color,Barcode Setting.)</h2> <h2 class="oe_slogan">App Search By Date or Number Range</h2>
<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%;">
<h3>Please install <a href="https://www.odoo.com/apps/modules/10.0/app_odoo_customize/" target="_blank">app_odoo_customize</a> First.</h3> <h3>Please install <a href="https://www.odoo.com/apps/modules/10.0/app_odoo_customize/" target="_blank">app_odoo_customize</a> First.</h3>
<p>This moduld allows user to Search by date or number range in List view and Pivot view. </p> <p>This moduld allows user to Search by date or number range in List view and Pivot view. </p>
@@ -55,7 +55,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 what you need</p> <p>Setup what you need</p>
<div class="oe_demo oe_screenshot"> <div class="oe_demo oe_picture oe_screenshot">
<img src="setup1.jpg"> <img src="setup1.jpg">
</div> </div>
<p>2. Go to Menu: Settings->Technical->Parameters->System Parameters</p> <p>2. Go to Menu: Settings->Technical->Parameters->System Parameters</p>

View File

@@ -10,7 +10,19 @@
content: ""; content: "";
} }
/* /*
强制表格滚动,企业版中生效 list标头不换行
*/
.table-responsive {
white-space: nowrap !important;
}
/*
sheet全宽
*/
.o_form_view .o_form_sheet_bg .o_form_sheet {
max-width: 98%!important;
}
/*
强制表格滚动,企业版/社区版中生效
*/ */
.force_scroll .table-responsive { .force_scroll .table-responsive {

View File

@@ -27,6 +27,7 @@
</group> </group>
<group string="Report Setting"> <group string="Report Setting">
<field name="app_ui_force_barcode"/> <field name="app_ui_force_barcode"/>
<field name="app_ui_allow_barcode"/>
</group> </group>
</form> </form>
</field> </field>