mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
Initial port to v7.0. Not tested a lot for the moment.
This commit is contained in:
committed by
Alexis de Lattre
parent
f80e49e8da
commit
06630f9f09
@@ -2,7 +2,7 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Report intrastat base module for OpenERP
|
||||
# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved
|
||||
# Copyright (C) 2011-2013 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -23,6 +23,6 @@
|
||||
import country
|
||||
import product
|
||||
import tax
|
||||
import partner_address
|
||||
import partner
|
||||
import intrastat_common
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Report intrastat base module for OpenERP
|
||||
# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved
|
||||
# Copyright (C) 2011-2013 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -22,14 +22,15 @@
|
||||
|
||||
|
||||
{
|
||||
'name': 'Base module for Intrastat reporting',
|
||||
'name': 'Intrastat Reporting Base',
|
||||
'version': '1.1',
|
||||
'category': 'Localisation/Report Intrastat',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Base module for Intrastat reporting',
|
||||
'description': """This module contains the common functions for 2 other modules :
|
||||
- l10n_fr_intrastat_service : the module for the "Déclaration Européenne des Services" (DES)
|
||||
- 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 is not usefull if it's not used together with one of those 2 modules or other country-specific intrastat 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.
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
class res_country(osv.osv):
|
||||
class res_country(osv.Model):
|
||||
_inherit = 'res.country'
|
||||
_columns = {
|
||||
'intrastat': fields.boolean('EU country', help="Set to True for all European Union countries."),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>)
|
||||
Copyright (C) 2011-2013 Akretion (http://www.akretion.com)
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<field name="inherit_id" ref="base.view_country_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="code" position="after">
|
||||
<field name="intrastat" select="1" />
|
||||
<field name="intrastat" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Report intrastat base module for OpenERP
|
||||
# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/). All rights reserved.
|
||||
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). All rights reserved.
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -20,12 +20,12 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from openerp.osv import osv
|
||||
from openerp.tools.translate import _
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from tools.translate import _
|
||||
|
||||
class report_intrastat_common(osv.osv_memory):
|
||||
class report_intrastat_common(osv.TransientModel):
|
||||
_name = "report.intrastat.common"
|
||||
_description = "Common functions for intrastat reports for products and services"
|
||||
|
||||
@@ -115,7 +115,7 @@ class report_intrastat_common(osv.osv_memory):
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'current',
|
||||
'res_id': [attach_id],
|
||||
'res_id': attach_id,
|
||||
}
|
||||
return action
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2011 Akretion (http://www.akretion.com/)
|
||||
Copyright (C) 2011-2013 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
@@ -13,7 +13,7 @@
|
||||
<field name="vat">FR58441019213</field>
|
||||
</record>
|
||||
|
||||
<record id="base.res_partner_6" model="res.partner"> <!-- Elec Import -->
|
||||
<record id="base.res_partner_8" model="res.partner"> <!-- MediaPole -->
|
||||
<field name="vat">BE0828696437</field>
|
||||
<field name="supplier">True</field>
|
||||
</record>
|
||||
@@ -23,7 +23,7 @@
|
||||
<field name="supplier">True</field>
|
||||
</record>
|
||||
|
||||
<record id="base.res_partner_agrolait" model="res.partner">
|
||||
<record id="base.res_partner_2" model="res.partner"> <!-- Agrolait -->
|
||||
<field name="vat">BE0884025633</field>
|
||||
<field name="supplier">True</field>
|
||||
</record>
|
||||
@@ -48,7 +48,7 @@
|
||||
<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="categ_id" ref="product.product_category_all"/>
|
||||
<field name="list_price">30</field>
|
||||
<field name="is_accessory_cost">True</field>
|
||||
</record>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2011 Akretion (http://www.akretion.com/)
|
||||
Copyright (C) 2011-2013 Akretion (http://www.akretion.com/)
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Report intrastat base module for OpenERP
|
||||
# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/) All Rights Reserved
|
||||
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -20,16 +20,15 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
# We want to have the country field on res_partner_address always set
|
||||
# We want to have the country field on res_partner always set
|
||||
# because the selection of invoices for intrastat reports is based
|
||||
# on the country of the invoice partner address !
|
||||
class res_partner_address(osv.osv):
|
||||
_inherit = 'res.partner.address'
|
||||
# on the country of the invoice partner !
|
||||
class res_partner(osv.Model):
|
||||
_inherit = 'res.partner'
|
||||
_columns = {
|
||||
'country_id': fields.many2one('res.country', 'Country', required=True),
|
||||
}
|
||||
|
||||
res_partner_address()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Report intrastat base module for OpenERP
|
||||
# Copyright (C) 2010-2012 Akretion (http://www.akretion.com/) All Rights Reserved
|
||||
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -20,10 +20,10 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
from openerp.osv import osv, fields
|
||||
from openerp.tools.translate import _
|
||||
|
||||
class product_template(osv.osv):
|
||||
class product_template(osv.Model):
|
||||
_inherit = "product.template"
|
||||
_columns = {
|
||||
'exclude_from_intrastat': fields.boolean('Exclude from Intrastat reports', help="If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason."),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2010-2011 Akretion (http://www.akretion.com/)
|
||||
Copyright (C) 2010-2013 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
@@ -15,17 +15,12 @@
|
||||
<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"/>
|
||||
<group colspan="4">
|
||||
<field name="exclude_from_intrastat" />
|
||||
</group>
|
||||
</field>
|
||||
<field name="purchase_ok" position="after">
|
||||
<group name="properties" position="after">
|
||||
<group string="Intrastat properties" name="intrastat">
|
||||
<field name="exclude_from_intrastat" />
|
||||
<field name="is_accessory_cost" />
|
||||
</field>
|
||||
</data>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -35,17 +30,12 @@
|
||||
<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"/>
|
||||
<group colspan="4">
|
||||
<field name="exclude_from_intrastat" />
|
||||
</group>
|
||||
</field>
|
||||
<field name="purchase_ok" position="after">
|
||||
<field name="supplier_taxes_id" position="after">
|
||||
<group string="Intrastat properties" name="intrastat">
|
||||
<field name="exclude_from_intrastat" />
|
||||
<field name="is_accessory_cost" />
|
||||
</field>
|
||||
</data>
|
||||
</group>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Report intrastat base module for OpenERP
|
||||
# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved
|
||||
# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). All Rights Reserved
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -20,10 +20,10 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
|
||||
class account_tax(osv.osv):
|
||||
class account_tax(osv.Model):
|
||||
_inherit = "account.tax"
|
||||
_columns = {
|
||||
'exclude_from_intrastat_if_present': fields.boolean('Exclude invoice line from intrastat if this tax is present', help="If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices."),
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<field name="inherit_id" ref="account.view_tax_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<field name="type_tax_use" position="after">
|
||||
<field name="exclude_from_intrastat_if_present" />
|
||||
<field name="active" position="after">
|
||||
<field name="exclude_from_intrastat_if_present" />
|
||||
</field>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user