Browse Source

Initial port to v7.0. Not tested a lot for the moment.

pull/79/head^2
Alexis de Lattre 11 years ago
parent
commit
f9120eb80f
  1. 4
      intrastat_base/__init__.py
  2. 7
      intrastat_base/__openerp__.py
  3. 4
      intrastat_base/country.py
  4. 4
      intrastat_base/country_view.xml
  5. 10
      intrastat_base/intrastat_common.py
  6. 8
      intrastat_base/intrastat_demo.xml
  7. 2
      intrastat_base/intrastat_menu.xml
  8. 13
      intrastat_base/partner.py
  9. 8
      intrastat_base/product.py
  10. 32
      intrastat_base/product_view.xml
  11. 6
      intrastat_base/tax.py
  12. 11
      intrastat_base/tax_view.xml

4
intrastat_base/__init__.py

@ -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

7
intrastat_base/__openerp__.py

@ -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.

4
intrastat_base/country.py

@ -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."),

4
intrastat_base/country_view.xml

@ -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>

10
intrastat_base/intrastat_common.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/). 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

8
intrastat_base/intrastat_demo.xml

@ -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>

2
intrastat_base/intrastat_menu.xml

@ -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
-->

13
intrastat_base/partner_address.py → intrastat_base/partner.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()

8
intrastat_base/product.py

@ -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."),

32
intrastat_base/product_view.xml

@ -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>

6
intrastat_base/tax.py

@ -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."),

11
intrastat_base/tax_view.xml

@ -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,18 +13,11 @@
<record id="intrastat_base_tax" model="ir.ui.view">
<field name="name">intrastat.base.tax</field>
<field name="model">account.tax</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_tax_form"/>
<field name="arch" type="xml">
<data>
<field name="active" position="after">
<!-- I put it in a group because this field has a very long label
and I want to avoid reducing the size of the other fields -->
<group colspan="6">
<field name="exclude_from_intrastat_if_present" />
</group>
<field name="exclude_from_intrastat_if_present" />
</field>
</data>
</field>
</record>

Loading…
Cancel
Save