mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
Add option "is_accessory_cost" on product.template : If the invoice has is_accessory_cost services but no regular product -> DES If the invoice has is_accessory_cost services and regular product -> added to the cost of products in DEB
Now allows "pricelist for statistical value" which is not in EUR (the currency conversion will be made from the pricelist currency to EUR) Usability improvements : - Order for DEB and DES tree view : "the more recent at the top" - distinction between "Information to declare" and "Additionnal information" in intrastat lines
This commit is contained in:
committed by
Alexis de Lattre
parent
8f38ce5bec
commit
9fe090148e
@@ -50,7 +50,7 @@
|
||||
<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>
|
||||
<field name="is_accessory_cost">True</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
@@ -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-2012 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
|
||||
@@ -21,16 +21,29 @@
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class product_template(osv.osv):
|
||||
_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."),
|
||||
'is_accessory_cost' : fields.boolean('Is accessory cost?', help='Activate this option for shipping costs, packaging costs and all services related to the sale of product. This option is used for Intrastat reports.'),
|
||||
}
|
||||
|
||||
_default = {
|
||||
'exclude_from_intrastat': lambda *a: False,
|
||||
}
|
||||
|
||||
|
||||
def _check_accessory_cost(self, cr, uid, ids):
|
||||
for product in self.browse(cr, uid, ids):
|
||||
if product.is_accessory_cost and product.type != 'service':
|
||||
raise osv.except_osv(_('Error :'), _("The option 'Is accessory cost?' should only be activated on 'Service' products. You have activated this option for the product '%s' which is of type '%s'" % (product.name, product.type)))
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_accessory_cost, "Error msg is in raise", ['is_accessory_cost', 'type'])
|
||||
]
|
||||
|
||||
product_template()
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
<field name="exclude_from_intrastat" />
|
||||
</group>
|
||||
</field>
|
||||
<field name="purchase_ok" position="after">
|
||||
<field name="is_accessory_cost" />
|
||||
</field>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
@@ -39,6 +42,9 @@
|
||||
<field name="exclude_from_intrastat" />
|
||||
</group>
|
||||
</field>
|
||||
<field name="purchase_ok" position="after">
|
||||
<field name="is_accessory_cost" />
|
||||
</field>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user