diff --git a/intrastat_base/__terp__.py b/intrastat_base/__terp__.py index 6ad92af0..a048ca22 100644 --- a/intrastat_base/__terp__.py +++ b/intrastat_base/__terp__.py @@ -47,7 +47,7 @@ Please contact Alexis de Lattre from Akretion for 'country_view.xml', 'intrastat_menu.xml', ], - 'demo_xml': ['product_demo.xml'], + 'demo_xml': ['intrastat_demo.xml'], 'installable': True, 'active': False, } diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 240641dd..011a0500 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -102,7 +102,23 @@ class report_intrastat_common(osv.osv_memory): context = {} context.update({'default_res_id' : ids[0], 'default_res_model': object._name}) attach_id = attach_obj.create(cr, uid, {'name': attach_name, 'datas': base64.encodestring(xml_string), 'datas_fname': filename}, context=context) - return None + return attach_id + + + def _open_attach_view(self, cr, uid, attach_id, title='XML file', context=None): + '''Returns an action which opens the form view of the corresponding attachement''' + action = { + 'name': title, + 'view_type': 'form', + 'view_mode': 'form,tree', + 'view_id': False, + 'res_model': 'ir.attachment', + 'type': 'ir.actions.act_window', + 'nodestroy': True, + 'target': 'current', + 'res_id': [attach_id], + } + return action def partner_on_change(self, cr, uid, ids, partner_id=False): diff --git a/intrastat_base/intrastat_demo.xml b/intrastat_base/intrastat_demo.xml new file mode 100644 index 00000000..31aa5658 --- /dev/null +++ b/intrastat_base/intrastat_demo.xml @@ -0,0 +1,57 @@ + + + + + + + + + FR58441019213 + + + + BE0828696437 + True + + + + BE0443167858 + True + + + + BE0884025633 + True + + + + True + + + + True + + + + True + + + + True + + + + Shipping costs + SHIP + service + + 30 + False + + + + diff --git a/intrastat_base/product_demo.xml b/intrastat_base/product_demo.xml deleted file mode 100644 index f29f16dd..00000000 --- a/intrastat_base/product_demo.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - Shipping costs - SHIP - service - - 30 - False - - - -