Skip to content

Commit

Permalink
we_export_view_good 模块的进一步的优化调整.
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbert-yuan committed Sep 5, 2016
1 parent 0e21c71 commit a209538
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 13 deletions.
3 changes: 2 additions & 1 deletion core/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
'web_menu_create',
'decimal_precision',
'web_readonly_bypass',
'mail'],
'mail',
'web_export_view_good'],
'demo': [
'core_demo.xml',
],
Expand Down
1 change: 1 addition & 0 deletions finance/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'security/ir.model.access.csv',
'data/finance_voucher_data.xml',
'data/finance_data.xml',
'data/finance_export_template_data.xml',
'res_config_view.xml',
'finance_conf.xml',
'wizard/checkout_wizard.xml',
Expand Down
9 changes: 9 additions & 0 deletions finance/data/finance_export_template_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record id="template_1" model="report.template">
<field name="model_name">balance.sheet</field>
<field name="file_address">finance/template/balance_sheet_tempalte.xls</field>
</record>
</data>
</openerp>
Binary file added finance/template/balance_sheet_tempalte.xls
Binary file not shown.
2 changes: 1 addition & 1 deletion web_export_view_good/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'website': 'http://www.agilebg.com',
'license': 'AGPL-3',
'depends': [
'web', 'core',
'web'
],
'data': [
'view/web_export_view.xml',
Expand Down
5 changes: 3 additions & 2 deletions web_export_view_good/controllers/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ class ReportTemplate(models.Model):
_name = "report.template"
model_id = fields.Many2one('ir.model',u'模型')
file_address = fields.Char(u'模板文件路径')
model_name = fields.Char(u'模型')
model_name = fields.Char(u'模型名称')

@api.onchange('model_id')
def _onchange_model_id(self):
if self.model_id:
self.model_name = self.model_id.model

@api.model
def get_time(self, model):
ISOTIMEFORMAT = "%Y-%m-%d"
Expand Down Expand Up @@ -118,7 +120,6 @@ def from_data(self, fields, rows, file_address):
base_style = xlwt.easyxf('align: wrap yes')
date_style = xlwt.easyxf('align: wrap yes', num_format_str='YYYY-MM-DD')
datetime_style = xlwt.easyxf('align: wrap yes', num_format_str='YYYY-MM-DD HH:mm:SS')

for row_index, row in enumerate(rows):
for cell_index, cell_value in enumerate(row):
cell_style = base_style
Expand Down
2 changes: 0 additions & 2 deletions web_export_view_good/static/src/js/web_export_view_good.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ openerp.web_export_view_good = function (instance) {
operation_message[3]=_t(now_day.trim());
export_rows.push(operation_message);
if (self.view.dataset.context.attachment_information !==undefined){
//export_rows.push([])
//export_rows.push([self.view.dataset.context.attachment_information]);}
var arr = self.view.dataset.context.attachment_information.split(",");
var newArray = [];//new Array();
for ( var i = 0; i < arr.length; i++) {
Expand Down
7 changes: 0 additions & 7 deletions web_export_view_good/view/web_export_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,4 @@
</record>
<menuitem id='report_template_action_menu' action='report_template_action' parent='base.menu_config' sequence='10'/>
</data>
<!--
<data no_update="1">
<record id="template_1" model="report.template">
<field name="model_name"/>res.country</record>
<field name="file_address">web_export_view_good/tests/hello.xls</field>
</record>
</data>-->
</openerp>

0 comments on commit a209538

Please sign in to comment.