[MERGE]
bzr revid: stephane@tinyerp.com-20090520125434-x9qiim1awpnhm95l
This commit is contained in:
commit
2e9c072e69
|
@ -75,7 +75,7 @@
|
||||||
<separator colspan="4" string="Price Computation"/>
|
<separator colspan="4" string="Price Computation"/>
|
||||||
|
|
||||||
<field name="base"/>
|
<field name="base"/>
|
||||||
<field name="base_pricelist_id"/>
|
<field name="base_pricelist_id" attrs="{'required': [('base','=', -1)], 'readonly': [('base','!=', -1)]}"/>
|
||||||
<group col="6" colspan="5">
|
<group col="6" colspan="5">
|
||||||
<label string="New Price ="/>
|
<label string="New Price ="/>
|
||||||
<label string="Base Price"/>
|
<label string="Base Price"/>
|
||||||
|
|
|
@ -198,6 +198,7 @@
|
||||||
<tree colors="red:date_planned<=current_date" string="Purchase Order Line">
|
<tree colors="red:date_planned<=current_date" string="Purchase Order Line">
|
||||||
<field name="date_planned"/>
|
<field name="date_planned"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
|
<field name="product_id"/>
|
||||||
<field name="product_qty"/>
|
<field name="product_qty"/>
|
||||||
<field name="product_uom"/>
|
<field name="product_uom"/>
|
||||||
<field name="price_unit"/>
|
<field name="price_unit"/>
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import osv, fields
|
from osv import osv, fields
|
||||||
import tools.sql
|
from tools.sql import drop_view_if_exists
|
||||||
|
|
||||||
|
|
||||||
class res_country(osv.osv):
|
class res_country(osv.osv):
|
||||||
_name = 'res.country'
|
_name = 'res.country'
|
||||||
|
@ -32,8 +33,10 @@ class res_country(osv.osv):
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'intrastat': lambda *a: False,
|
'intrastat': lambda *a: False,
|
||||||
}
|
}
|
||||||
|
|
||||||
res_country()
|
res_country()
|
||||||
|
|
||||||
|
|
||||||
class report_intrastat_code(osv.osv):
|
class report_intrastat_code(osv.osv):
|
||||||
_name = "report.intrastat.code"
|
_name = "report.intrastat.code"
|
||||||
_description = "Intrastat code"
|
_description = "Intrastat code"
|
||||||
|
@ -41,14 +44,17 @@ class report_intrastat_code(osv.osv):
|
||||||
'name': fields.char('Intrastat Code', size=16),
|
'name': fields.char('Intrastat Code', size=16),
|
||||||
'description': fields.char('Description', size=64),
|
'description': fields.char('Description', size=64),
|
||||||
}
|
}
|
||||||
|
|
||||||
report_intrastat_code()
|
report_intrastat_code()
|
||||||
|
|
||||||
|
|
||||||
class product_template(osv.osv):
|
class product_template(osv.osv):
|
||||||
_name = "product.template"
|
_name = "product.template"
|
||||||
_inherit = "product.template"
|
_inherit = "product.template"
|
||||||
_columns = {
|
_columns = {
|
||||||
'intrastat_id': fields.many2one('report.intrastat.code', 'Intrastat code'),
|
'intrastat_id': fields.many2one('report.intrastat.code', 'Intrastat code'),
|
||||||
}
|
}
|
||||||
|
|
||||||
product_template()
|
product_template()
|
||||||
|
|
||||||
class report_intrastat(osv.osv):
|
class report_intrastat(osv.osv):
|
||||||
|
@ -56,9 +62,9 @@ class report_intrastat(osv.osv):
|
||||||
_description = "Intrastat report"
|
_description = "Intrastat report"
|
||||||
_auto = False
|
_auto = False
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.many2one('account.period', 'Period', readonly=True,select=True),
|
'name': fields.many2one('account.period', 'Period', readonly=True, select=True),
|
||||||
'supply_units':fields.float('Supply Units', readonly=True),
|
'supply_units': fields.float('Supply Units', readonly=True),
|
||||||
'ref':fields.char('Origin',size=64, readonly=True),
|
'ref': fields.char('Origin', size=64, readonly=True),
|
||||||
'code': fields.char('Country code', size="2", readonly=True),
|
'code': fields.char('Country code', size="2", readonly=True),
|
||||||
'intrastat_id': fields.many2one('report.intrastat.code', 'Intrastat code', readonly=True),
|
'intrastat_id': fields.many2one('report.intrastat.code', 'Intrastat code', readonly=True),
|
||||||
'weight': fields.float('Weight', readonly=True),
|
'weight': fields.float('Weight', readonly=True),
|
||||||
|
@ -67,7 +73,7 @@ class report_intrastat(osv.osv):
|
||||||
'currency_id': fields.many2one('res.currency', "Currency", readonly=True),
|
'currency_id': fields.many2one('res.currency', "Currency", readonly=True),
|
||||||
}
|
}
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
tools.sql.drop_view_if_exists(cr, 'report_intrastat')
|
drop_view_if_exists(cr, 'report_intrastat')
|
||||||
cr.execute("""
|
cr.execute("""
|
||||||
create or replace view report_intrastat as (
|
create or replace view report_intrastat as (
|
||||||
select
|
select
|
||||||
|
@ -125,11 +131,8 @@ class report_intrastat(osv.osv):
|
||||||
inv.state in ('open','paid')
|
inv.state in ('open','paid')
|
||||||
and inv_line.product_id is not null
|
and inv_line.product_id is not null
|
||||||
and inv_country.intrastat=true
|
and inv_country.intrastat=true
|
||||||
|
|
||||||
group by inv.period_id,intrastat.id,inv.type,pt.intrastat_id, inv_country.code,inv.number, inv.currency_id
|
group by inv.period_id,intrastat.id,inv.type,pt.intrastat_id, inv_country.code,inv.number, inv.currency_id
|
||||||
)""")
|
)""")
|
||||||
|
|
||||||
report_intrastat()
|
report_intrastat()
|
||||||
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue