Browse Source

Complete change of design for intrastat_type !

Now that report_intrastat_product/service object is stored in database, we don't need the legal_intrastat state on invoices any more, because we will be able to create entry lines for DEB for a repair of equipment under warranty without using a legal_intrastat.
Report_intrastat_type is now only required for DEB -> object moved to module l10n_fr_intrastat_product.
For DEB, the button "regenerate lines" only regenerate DEB lines related to invoices.

Renamed intrastat base module, because it doesn't have France-specific parameters any more.

Add demo data.
pull/79/head^2
Alexis de Lattre 13 years ago
parent
commit
a590f15811
  1. 3
      intrastat_base/__init__.py
  2. 13
      intrastat_base/__terp__.py
  3. 0
      intrastat_base/country.py
  4. 0
      intrastat_base/country_data.xml
  5. 8
      intrastat_base/country_view.xml
  6. 7
      intrastat_base/intrastat_common.py
  7. 16
      intrastat_base/intrastat_menu.xml
  8. 0
      intrastat_base/partner_address.py
  9. 0
      intrastat_base/product.py
  10. 22
      intrastat_base/product_demo.xml
  11. 16
      intrastat_base/product_view.xml
  12. 1
      intrastat_base/security/ir.model.access.csv
  13. 47
      l10n_fr_intrastat_base/account_invoice.py
  14. 173
      l10n_fr_intrastat_base/account_invoice_view.xml
  15. 24
      l10n_fr_intrastat_base/account_invoice_workflow.xml
  16. 32
      l10n_fr_intrastat_base/company.py
  17. 27
      l10n_fr_intrastat_base/company_view.xml
  18. 65
      l10n_fr_intrastat_base/intrastat_type.py
  19. 31
      l10n_fr_intrastat_base/intrastat_type_data.xml
  20. 98
      l10n_fr_intrastat_base/intrastat_type_view.xml

3
l10n_fr_intrastat_base/__init__.py → intrastat_base/__init__.py

@ -20,11 +20,8 @@
#
##############################################################################
import intrastat_type
import country
import product
import account_invoice
import partner_address
import company
import intrastat_common

13
l10n_fr_intrastat_base/__terp__.py → intrastat_base/__terp__.py

@ -22,7 +22,7 @@
{
'name': 'Base module for Intrastat reporting (DEB & DES) for France',
'name': 'Base module for Intrastat reporting',
'version': '1.1',
'category': 'Localisation/Report Intrastat',
'license': 'AGPL-3',
@ -31,6 +31,8 @@
- l10n_fr_intrastat_product : the module for the "Déclaration d'Echange de Biens" (DEB)
This module is not usefull if it's not used together with one of those 2 modules.
This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries.
WARNING : this module conflicts with the module "report_intrastat" from the addons. If you have already installed the module "report_intrastat", you should uninstall it first before installing this module.
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
@ -38,17 +40,14 @@ Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['account'],
'init_xml': ['country_data.xml', 'intrastat_type_data.xml'],
'init_xml': ['country_data.xml'],
'update_xml': [
'security/ir.model.access.csv',
'product_view.xml',
'country_view.xml',
'intrastat_type_view.xml',
'company_view.xml',
'account_invoice_view.xml',
'account_invoice_workflow.xml',
'intrastat_menu.xml',
],
'demo_xml': [],
'demo_xml': ['product_demo.xml'],
'installable': True,
'active': False,
}

0
l10n_fr_intrastat_base/country.py → intrastat_base/country.py

0
l10n_fr_intrastat_base/country_data.xml → intrastat_base/country_data.xml

8
l10n_fr_intrastat_base/country_view.xml → intrastat_base/country_view.xml

@ -9,8 +9,8 @@
<data>
<!-- Add intrastat field on res_country -->
<record id="fr_intrastat_base_country_tree" model="ir.ui.view">
<field name="name">fr.intrastat.base.country.tree</field>
<record id="intrastat_base_country_tree" model="ir.ui.view">
<field name="name">intrastat.base.country.tree</field>
<field name="model">res.country</field>
<field name="inherit_id" ref="base.view_country_tree" />
<field name="arch" type="xml">
@ -20,8 +20,8 @@
</field>
</record>
<record id="fr_intrastat_base_country_form" model="ir.ui.view">
<field name="name">fr.intrastat.base.country.form</field>
<record id="intrastat_base_country_form" model="ir.ui.view">
<field name="name">intrastat.base.country.form</field>
<field name="model">res.country</field>
<field name="inherit_id" ref="base.view_country_form" />
<field name="arch" type="xml">

7
l10n_fr_intrastat_base/intrastat_common.py → intrastat_base/intrastat_common.py

@ -30,7 +30,6 @@ class report_intrastat_common(osv.osv_memory):
_description = "Common functions for intrastat reports for products and services"
def _compute_numbers(self, cr, uid, ids, object, context=None):
print "COMMON START compute numbers ids=", ids
result = {}
for intrastat in object.browse(cr, uid, ids, context=context):
total_amount = 0.0
@ -39,18 +38,15 @@ class report_intrastat_common(osv.osv_memory):
total_amount += line.amount_company_currency
num_lines += 1
result[intrastat.id] = {'num_lines': num_lines, 'total_amount': total_amount}
print "COMMON _compute_numbers res = ", result
return result
def _compute_end_date(self, cr, uid, ids, object, context=None):
print "COMMON _compute_end_date START ids=", ids
result = {}
for intrastat in object.browse(cr, uid, ids, context=context):
start_date_datetime = datetime.strptime(intrastat.start_date, '%Y-%m-%d')
end_date_str = datetime.strftime(start_date_datetime + relativedelta(day=31), '%Y-%m-%d')
result[intrastat.id] = end_date_str
print "COMMON _compute_end_date res=", result
return result
@ -64,7 +60,6 @@ class report_intrastat_common(osv.osv_memory):
def _check_generate_lines(self, cr, uid, ids, intrastat, context=None):
print "START _check_generate_lines ids=", ids
if len(ids) != 1:
raise osv.except_osv(_('Error :'), 'Hara kiri in generate_lines')
if not intrastat.company_id.currency_id.code:
@ -75,7 +70,6 @@ class report_intrastat_common(osv.osv_memory):
def _check_generate_xml(self, cr, uid, ids, intrastat, context=None):
print "START _check_generate_xml ids=", ids
if len(ids) != 1:
raise osv.except_osv(_('Error :'), 'Hara kiri in generate_xml')
if not intrastat.company_id.partner_id.vat:
@ -108,7 +102,6 @@ class report_intrastat_common(osv.osv_memory):
attach_obj = self.pool.get('ir.attachment')
if not context:
context = {}
print "object name = ", object._name
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

16
intrastat_base/intrastat_menu.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2011 Akretion (http://www.akretion.com/)
The licence is in the file __terp__.py
-->
<openerp>
<data>
<!-- Menu entry for Intrastat -->
<menuitem id="menu_intrastat_base_root" name="Intrastat reporting" parent="account.menu_finance_legal_statement" />
</data>
</openerp>

0
l10n_fr_intrastat_base/partner_address.py → intrastat_base/partner_address.py

0
l10n_fr_intrastat_base/product.py → intrastat_base/product.py

22
intrastat_base/product_demo.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2011 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __terp__.py
-->
<openerp>
<data noupdate="1">
<record id="shipping_costs_exclude" model="product.product">
<field name="name">Shipping costs</field>
<field name="code">SHIP</field>
<field name="type">service</field>
<field name="categ_id" ref="product.product_category_services"/>
<field name="list_price">30</field>
<field name="exclude_from_intrastat">False</field>
</record>
</data>
</openerp>

16
l10n_fr_intrastat_base/product_view.xml → intrastat_base/product_view.xml

@ -10,30 +10,34 @@
<data>
<!-- Add field on product.product view -->
<record id="fr_intrastat_base_product_normal_form" model="ir.ui.view">
<field name="name">fr.intrastat.base.product.normal.form</field>
<record id="intrastat_base_product_normal_form" model="ir.ui.view">
<field name="name">intrastat.base.product.normal.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="account.product_normal_form_view" />
<field name="arch" type="xml">
<data>
<field name="property_account_expense" position="after">
<separator string="Intrastat properties" colspan="4"/>
<field name="exclude_from_intrastat" select="2" />
<group colspan="4">
<field name="exclude_from_intrastat" select="2" />
</group>
</field>
</data>
</field>
</record>
<!-- Same on product.template view -->
<record id="fr_intrastat_base_product_template_form" model="ir.ui.view">
<field name="name">fr.intrastat.base.product.template.form</field>
<record id="intrastat_base_product_template_form" model="ir.ui.view">
<field name="name">intrastat.base.product.template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="account.product_template_form_view"/>
<field name="arch" type="xml">
<data>
<field name="property_account_expense" position="after">
<separator string="Intrastat properties" colspan="4"/>
<field name="exclude_from_intrastat" select="2" />
<group colspan="4">
<field name="exclude_from_intrastat" select="2" />
</group>
</field>
</data>
</field>

1
l10n_fr_intrastat_base/security/ir.model.access.csv → intrastat_base/security/ir.model.access.csv

@ -1,3 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_report_intrastat_type","report.intrastat.type","model_report_intrastat_type","account.group_account_manager",1,1,1,1
"access_report_intrastat_common","Read access on report.intrastat.common","model_report_intrastat_common","base.group_user",1,0,0,0

47
l10n_fr_intrastat_base/account_invoice.py

@ -1,47 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Report intrastat base module for OpenERP
# Copyright (C) 2009-2011 Akretion (http://www.akretion.com/) All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
class account_invoice(osv.osv):
_inherit = "account.invoice"
_columns = {
'intrastat_type_id': fields.many2one('report.intrastat.type', 'Intrastat Type',select=True,readonly=True, states={'draft':[('readonly',False)]}),
'state': fields.selection([
('draft','Draft'),
('legal_intrastat','Legal Intrastat'),
('proforma','Pro-forma'),
('proforma2','Pro-forma'),
('open','Open'),
('paid','Done'),
('cancel','Cancelled')
],'State', select=True, readonly=True),
'intrastat_only': fields.boolean('Intrastat Only'),
}
def intrastat_type_id_change(self, cr, uid, ids, intrastat_type_id):
if intrastat_type_id:
intrastat_only = self.pool.get('report.intrastat.type').browse(cr, uid, intrastat_type_id).intrastat_only
return {'value': {'intrastat_only': intrastat_only}}
account_invoice()

173
l10n_fr_intrastat_base/account_invoice_view.xml

@ -1,173 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_report_intrastat_invoice_supplier_form">
<field name="name">report.intrastat.invoice.supplier</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form" />
<field name="arch" type="xml">
<field name="check_total" position="after">
<field name="intrastat_type_id" on_change="intrastat_type_id_change(intrastat_type_id)" domain="[('company_id','=',company_id)]" required="1" />
<field name="intrastat_only" invisible="True" />
</field>
</field>
</record>
<record model="ir.ui.view" id="view_report_intrastat_invoice_form">
<field name="name">report.intrastat.invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form" />
<field name="arch" type="xml">
<field name="payment_term" position="after">
<field name="intrastat_type_id" on_change="intrastat_type_id_change(intrastat_type_id)" domain="[('company_id','=',company_id)]" required="1" />
<field name="intrastat_only" invisible="True" />
</field>
</field>
</record>
<record model="ir.ui.view" id="view_report_intrastat_invoice_supplier_form_2">
<field name="name">report.intrastat.invoice.supplier.buttons</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form" />
<field name="arch" type="xml">
<button name="invoice_open" position="replace">
<group attrs="{'invisible':[('intrastat_only','=',True)]}">
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-execute" />
</group>
<group attrs="{'invisible':[('intrastat_only','=',False)]}">
<button name="invoice_legal_intrastat" states="draft" string="Legal Intrastat" icon="gtk-execute" />
</group>
</button>
</field>
</record>
<record model="ir.ui.view" id="view_report_intrastat_invoice_supplier_form_3">
<field name="name">report.intrastat.invoice.supplier.buttons</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form" />
<field name="arch" type="xml">
<button name="invoice_cancel" position="replace">
<button name="invoice_cancel" states="draft,proforma2,sale,open,legal_intrastat" string="Cancel" icon="gtk-cancel" />
</button>
</field>
</record>
<record model="ir.ui.view" id="view_report_intrastat_invoice_form_2">
<field name="name">report.intrastat.invoice.buttons</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form" />
<field name="arch" type="xml">
<button name="invoice_open" position="replace">
<group attrs="{'invisible':[('intrastat_only','=',True)]}">
<button name="invoice_open" states="draft,proforma2" string="Create" icon="gtk-execute" />
</group>
<group attrs="{'invisible':[('intrastat_only','=',False)]}">
<button name="invoice_legal_intrastat" states="draft" string="Legal Intrastat" icon="gtk-execute" />
</group>
</button>
</field>
</record>
<record model="ir.ui.view" id="view_report_intrastat_invoice_form_3">
<field name="name">report.intrastat.invoice.buttons</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form" />
<field name="arch" type="xml">
<button name="invoice_cancel" position="replace">
<button name="invoice_cancel" states="draft,proforma2,sale,open,legal_intrastat" string="Cancel" icon="gtk-cancel" />
</button>
</field>
</record>
<record id="action_invoice_tree14" model="ir.actions.act_window">
<field name="name">Customer Intrastat Invoices</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="domain">[('state','in',['legal_intrastat']),('type','=','out_invoice')]</field>
<field name="context">{'type':'out_invoice'}</field>
</record>
<record id="action_invoice_tree14_view1" model="ir.actions.act_window.view">
<field eval="1" name="sequence" />
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_invoice_tree14" />
</record>
<record id="action_invoice_tree14_view2" model="ir.actions.act_window.view">
<field eval="2" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="account.invoice_supplier_form" />
<field name="act_window_id" ref="action_invoice_tree14" />
</record>
<menuitem action="action_invoice_tree14" id="menu_action_invoice_tree14" parent="account.menu_action_invoice_tree1" />
<record id="action_invoice_tree15" model="ir.actions.act_window">
<field name="name">Supplier Intrastat Invoices</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="domain">[('state','in',['legal_intrastat']),('type','=','in_invoice')]</field>
<field name="context">{'type':'out_invoice'}</field>
</record>
<record id="action_invoice_tree15_view1" model="ir.actions.act_window.view">
<field eval="1" name="sequence" />
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_invoice_tree15" />
</record>
<record id="action_invoice_tree15_view2" model="ir.actions.act_window.view">
<field eval="2" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="account.invoice_supplier_form" />
<field name="act_window_id" ref="action_invoice_tree15" />
</record>
<menuitem action="action_invoice_tree15" id="menu_action_invoice_tree15" parent="account.menu_action_invoice_tree2" />
<record id="action_invoice_tree16" model="ir.actions.act_window">
<field name="name">Customer Intrastat Refunds</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="domain">[('state','in',['legal_intrastat']),('type','=','out_refund')]</field>
<field name="context">{'type':'out_refund'}</field>
</record>
<record id="action_invoice_tree16_view1" model="ir.actions.act_window.view">
<field eval="1" name="sequence" />
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_invoice_tree16" />
</record>
<record id="action_invoice_tree16_view2" model="ir.actions.act_window.view">
<field eval="2" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="account.invoice_supplier_form" />
<field name="act_window_id" ref="action_invoice_tree16" />
</record>
<menuitem action="action_invoice_tree16" id="menu_action_invoice_tree16" parent="account.menu_action_invoice_tree3" />
<record id="action_invoice_tree17" model="ir.actions.act_window">
<field name="name">Supplier Intrastat Refunds</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="domain">[('state','in',['legal_intrastat']),('type','=','in_refund')]</field>
<field name="context">{'type':'in_refund'}</field>
</record>
<record id="action_invoice_tree17_view1" model="ir.actions.act_window.view">
<field eval="1" name="sequence" />
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_invoice_tree17" />
</record>
<record id="action_invoice_tree17_view2" model="ir.actions.act_window.view">
<field eval="2" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="account.invoice_supplier_form" />
<field name="act_window_id" ref="action_invoice_tree17" />
</record>
<menuitem action="action_invoice_tree17" id="menu_action_invoice_tree17" parent="account.menu_action_invoice_tree4" />
</data>
</openerp>

24
l10n_fr_intrastat_base/account_invoice_workflow.xml

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="act_legal_intrastat" model="workflow.activity">
<field name="wkf_id" ref="account.wkf" />
<field name="name">legal_intrastat</field>
<field name="action">write({'state':'legal_intrastat'})</field>
<field name="kind">function</field>
</record>
<record id="t1" model="workflow.transition">
<field name="act_from" ref="account.act_draft" />
<field name="act_to" ref="act_legal_intrastat" />
<field name="signal">invoice_legal_intrastat</field>
</record>
<record id="t2" model="workflow.transition">
<field name="act_from" ref="act_legal_intrastat" />
<field name="act_to" ref="account.act_cancel" />
<field name="signal">invoice_cancel</field>
</record>
</data>
</openerp>

32
l10n_fr_intrastat_base/company.py

@ -1,32 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Report intrastat base module for OpenERP
# Copyright (C) 2009-2011 Akretion (http://www.akretion.com/) All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
class res_company(osv.osv):
_name = "res.company"
_inherit = "res.company"
_columns = {
'intrastat_type_ids': fields.one2many('report.intrastat.type', 'company_id', 'Intrastat Type'),
}
res_company()

27
l10n_fr_intrastat_base/company_view.xml

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2010-2011 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __terp__.py
-->
<openerp>
<data>
<record id="fr_intrastat_base_company_form" model="ir.ui.view">
<field name="name">fr.intrastat.base.company.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml">
<notebook>
<page position="inside" string="France intrastat settings">
<separator colspan="4" string="Intrastat Type" />
<field nolabel="1" colspan="4" name="intrastat_type_ids" />
</page>
</notebook>
</field>
</record>
</data>
</openerp>

65
l10n_fr_intrastat_base/intrastat_type.py

@ -1,65 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Report intrastat base module for OpenERP
# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/) All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
class report_intrastat_type(osv.osv):
_name = "report.intrastat.type"
_description = "Intrastat type"
_order = "type, intrastat_only"
_columns = {
'name': fields.char('Name',size=64,help="Name which appear when you select the Intrastat type on the invoice."),
'active' : fields.boolean('Active', help="The active field allows you to hide the Intrastat type without deleting it."),
'company_id': fields.many2one('res.company', 'Company'),
'type': fields.selection([('import', 'Import'),('export', 'Export'), ('other', 'Other')], 'Value', required=True, help="If 'Import' is selected, the corresponding invoices will be selected for the 'Intrastat Import' reports. Same for 'Export'. If 'Other' is selected, the corresponding invoices will NOT be selected in any Intrastat report ; so you should choose it for an invoice only in very particular cases."),
'intrastat_only': fields.boolean('Intrastat only', help="An invoice which has an Intrastat type which is 'Intrastat only' = true is not a real invoice i.e. once created it won't have an invoice number nor corresponding accounting entries. It follows a different path in the invoice workflow and it's state once created is called 'legal intrastat'. So the purpose of an 'intrastat only' invoice is to add entries to the Intrastat report without impacting anything else. This is used for example for a repair under warranty : nothing is invoiced to the customer, but it creates a movement of goods which should be part of the Intrastat report with a certain value.")
}
_defaults = {
'active': lambda *a: 1,
}
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
if not args:
args=[]
if context is None:
context={}
ids = []
if context.get('type', False) == 'out_invoice':
args = args+['|',('type','=','export'), ('type','=','other')]
if context.get('type', False) == 'in_invoice':
args = args+['|',('type','=','import'), ('type','=','other')]
if context.get('type', False) == 'in_refund':
args = args+['|',('type','=','export'), ('type','=','other')]
if context.get('type', False) == 'out_refund':
args = args+['|',('type','=','import'), ('type','=','other')]
return super(report_intrastat_type,self).search(cr, user, args, offset, limit, order, context=context, count=count)
report_intrastat_type()

31
l10n_fr_intrastat_base/intrastat_type_data.xml

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2010-2011 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __terp__.py
-->
<openerp>
<data noupdate="1">
<record id="regular_export" model="report.intrastat.type">
<field name="name">Regular export</field>
<field name="company_id" ref="base.main_company"/>
<field name="type">export</field>
</record>
<record id="regular_import" model="report.intrastat.type">
<field name="name">Regular import</field>
<field name="company_id" ref="base.main_company"/>
<field name="type">import</field>
</record>
<record id="other" model="report.intrastat.type">
<field name="name">Exclude from intrastat (special)</field>
<field name="company_id" ref="base.main_company"/>
<field name="type">other</field>
</record>
</data>
</openerp>

98
l10n_fr_intrastat_base/intrastat_type_view.xml

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2010-2011 Akretion (http://www.akretion.com/)
The licence is in the file __terp__.py
-->
<openerp>
<data>
<!-- Intrastat Type - Tree view for Users > Companies-->
<record id="fr_intrastat_base_report_intrastat_type_tree" model="ir.ui.view">
<field name="name">fr.intrastat.base.report.intrastat.type.tree</field>
<field name="model">report.intrastat.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Intrastat Type">
<field name="name" />
<field name="type" />
<field name="intrastat_only" />
</tree>
</field>
</record>
<!-- Intrastat Type - Form view for Users > Companies-->
<record id="fr_intrastat_base_report_intrastat_type_form" model="ir.ui.view">
<field name="name">fr.intrastat.base.report.intrastat.type.form</field>
<field name="model">report.intrastat.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Intrastat Type">
<field name="name" select="1" />
<field name="active" select="2" />
<field name="type" select="1" />
<field name="intrastat_only" select="2" />
</form>
</field>
</record>
<!-- Intrastat type - Tree view for Configuration -->
<record id="fr_intrastat_base_report_intrastat_type_config_tree" model="ir.ui.view">
<field name="name">fr.intrastat.base.report.intrastat.type.config.tree</field>
<field name="model">report.intrastat.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Intrastat type">
<field name="company_id" />
<field name="name" />
<field name="type" />
<field name="intrastat_only" />
</tree>
</field>
</record>
<!-- Intrastat type - Form view for Configuration -->
<record id="fr_intrastat_base_report_intrastat_type_config_form" model="ir.ui.view">
<field name="name">fr.intrastat.base.report.intrastat.type.config.form</field>
<field name="model">report.intrastat.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Intrastat type">
<field name="company_id" select="1" />
<field name="name" select="1" />
<field name="active" select="2" />
<field name="type" select="1" />
<field name="intrastat_only" select="2" />
</form>
</field>
</record>
<!-- Intrastat type - Action for Configuration -->
<record id="act_fr_intrastat_base_report_intrastat_type_config" model="ir.actions.act_window">
<field name="name">Intrastat types</field>
<field name="res_model">report.intrastat.type</field>
<field name="view_type">form</field>
</record>
<record id="act_fr_intrastat_base_report_intrastat_type_config_tree" model="ir.actions.act_window.view">
<field eval="10" name="sequence" /> <!-- open tree view first -->
<field name="view_mode">tree</field>
<field name="view_id" ref="fr_intrastat_base_report_intrastat_type_config_tree" />
<field name="act_window_id" ref="act_fr_intrastat_base_report_intrastat_type_config" />
</record>
<record id="act_fr_intrastat_base_report_intrastat_type_config_form" model="ir.actions.act_window.view">
<field eval="20" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="fr_intrastat_base_report_intrastat_type_config_form" />
<field name="act_window_id" ref="act_fr_intrastat_base_report_intrastat_type_config" />
</record>
<!-- Menu entry for Intrastat -->
<menuitem id="menu_fr_intrastat_base_root" name="Intrastat reporting" parent="account.menu_finance_legal_statement" />
</data>
</openerp>
Loading…
Cancel
Save