From 9c7aaeb2304ccc98b75003f612b07b27a614d8f8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 26 Apr 2011 09:28:46 +0200 Subject: [PATCH] Moved some demo data from l10n_fr_intrastat_product to intrastat_base Moved configuration about taxes from company form to tax form Some modifications to ease v5 -> v6 migration : - object report_intrastat_code now belong to group account manager - button functions now return True Tried to implement the following feature : open attachement form when the XML file as been generated : works on v6, but make client crash en v5 -> code has been commented DEB lines with procedure code = 25 are now deducted from the fiscal total. Round invoice total. --- intrastat_base/__terp__.py | 2 +- intrastat_base/intrastat_common.py | 18 +++++++++- intrastat_base/intrastat_demo.xml | 57 ++++++++++++++++++++++++++++++ intrastat_base/product_demo.xml | 22 ------------ 4 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 intrastat_base/intrastat_demo.xml delete mode 100644 intrastat_base/product_demo.xml 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 - - - -