commit
8efceccd5d
|
@ -62,7 +62,7 @@ period_fields = {
|
||||||
'default': lambda *a:False,
|
'default': lambda *a:False,
|
||||||
'help': 'Keep empty for all open fiscal year'
|
'help': 'Keep empty for all open fiscal year'
|
||||||
},
|
},
|
||||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
|
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
|
||||||
'result_selection':{
|
'result_selection':{
|
||||||
'string':"Partner",
|
'string':"Partner",
|
||||||
'type':'selection',
|
'type':'selection',
|
||||||
|
|
|
@ -111,43 +111,51 @@ class wizard_base_setup(wizard.interface):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _get_company(self, cr, uid, data, context):
|
def _get_company(self, cr, uid, data, context):
|
||||||
pool=pooler.get_pool(cr.dbname)
|
pool = pooler.get_pool(cr.dbname)
|
||||||
company_obj=pool.get('res.company')
|
company_obj = pool.get('res.company')
|
||||||
ids=company_obj.search(cr, uid, [])
|
ids=company_obj.search(cr, uid, [])
|
||||||
if not ids:
|
if not ids:
|
||||||
return {}
|
return {}
|
||||||
company=company_obj.browse(cr, uid, ids)[0]
|
company = company_obj.browse(cr, uid, ids)[0]
|
||||||
self.fields['name']['default']=company.name
|
|
||||||
self.fields['currency']['default']=company.currency_id.id
|
res = {'currency': company.currency_id.id}
|
||||||
serv_pro_id = pooler.get_pool(cr.dbname).get('ir.module.module').search(cr, uid, [('name','=','profile_service')]) or False
|
|
||||||
|
for field in 'name logo rml_header1 rml_footer1 rml_footer2'.split():
|
||||||
|
res[field] = company[field]
|
||||||
|
|
||||||
|
if company.partner_id.address:
|
||||||
|
address = company.partner_id.address[0]
|
||||||
|
for field in 'street street2 zip city email phone'.split():
|
||||||
|
res[field] = address[field]
|
||||||
|
|
||||||
|
for field in 'country_id state_id'.split():
|
||||||
|
if address[field]:
|
||||||
|
res[field] = address[field].id
|
||||||
|
|
||||||
|
serv_pro_id = pool.get('ir.module.module').search(cr, uid, [('name','=','profile_service')]) or False
|
||||||
if serv_pro_id:
|
if serv_pro_id:
|
||||||
return {'profile':serv_pro_id[0]}
|
res['profile'] = serv_pro_id[0]
|
||||||
return {}
|
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def _get_all(self, cr, uid, context, model):
|
||||||
|
pool = pooler.get_pool(cr.dbname)
|
||||||
|
obj = pool.get(model)
|
||||||
|
ids = obj.search(cr, uid, [])
|
||||||
|
res = [(o.id, o.name) for o in obj.browse(cr, uid, ids, context=context)]
|
||||||
|
res.append((-1, ''))
|
||||||
|
res.sort(key=lambda x: x[1])
|
||||||
|
return res
|
||||||
|
|
||||||
def _get_states(self, cr, uid, context):
|
def _get_states(self, cr, uid, context):
|
||||||
pool=pooler.get_pool(cr.dbname)
|
return self._get_all(cr, uid, context, 'res.country.state')
|
||||||
state_obj=pool.get('res.country.state')
|
|
||||||
ids=state_obj.search(cr, uid, [])
|
|
||||||
res=[(state.id, state.name) for state in state_obj.browse(cr, uid, ids, context=context)]
|
|
||||||
res.append((-1, ''))
|
|
||||||
res.sort(lambda x,y: cmp(x[1],y[1]))
|
|
||||||
return res
|
|
||||||
|
|
||||||
def _get_countries(self, cr, uid, context):
|
def _get_countries(self, cr, uid, context):
|
||||||
pool=pooler.get_pool(cr.dbname)
|
return self._get_all(cr, uid, context, 'res.country')
|
||||||
country_obj=pool.get('res.country')
|
|
||||||
ids=country_obj.search(cr, uid, [])
|
|
||||||
res=[(country.id, country.name) for country in country_obj.browse(cr, uid, ids, context=context)]
|
|
||||||
res.sort(lambda x,y: cmp(x[1],y[1]))
|
|
||||||
return res
|
|
||||||
|
|
||||||
def _get_currency(self, cr, uid, context):
|
def _get_currency(self, cr, uid, context):
|
||||||
pool=pooler.get_pool(cr.dbname)
|
return self._get_all(cr, uid, context, 'res.currency')
|
||||||
currency_obj=pool.get('res.currency')
|
|
||||||
ids=currency_obj.search(cr, uid, [])
|
|
||||||
res=[(currency.id, currency.name) for currency in currency_obj.browse(cr, uid, ids, context=context)]
|
|
||||||
res.sort(lambda x,y: cmp(x[1],y[1]))
|
|
||||||
return res
|
|
||||||
|
|
||||||
def _update(self, cr, uid, data, context):
|
def _update(self, cr, uid, data, context):
|
||||||
pool=pooler.get_pool(cr.dbname)
|
pool=pooler.get_pool(cr.dbname)
|
||||||
|
@ -256,7 +264,6 @@ class wizard_base_setup(wizard.interface):
|
||||||
'string':'Profile',
|
'string':'Profile',
|
||||||
'type':'selection',
|
'type':'selection',
|
||||||
'selection':_get_profiles,
|
'selection':_get_profiles,
|
||||||
# 'default': _get_service_profile,
|
|
||||||
'required': True,
|
'required': True,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
|
@ -25,14 +25,6 @@ from report import report_sxw
|
||||||
from osv import osv
|
from osv import osv
|
||||||
import pooler
|
import pooler
|
||||||
|
|
||||||
from tools.translate import _
|
|
||||||
|
|
||||||
parents = {
|
|
||||||
'tr':1,
|
|
||||||
'li':1,
|
|
||||||
'story': 0,
|
|
||||||
'section': 0
|
|
||||||
}
|
|
||||||
class product_pricelist(report_sxw.rml_parse):
|
class product_pricelist(report_sxw.rml_parse):
|
||||||
def __init__(self, cr, uid, name, context):
|
def __init__(self, cr, uid, name, context):
|
||||||
super(product_pricelist, self).__init__(cr, uid, name, context)
|
super(product_pricelist, self).__init__(cr, uid, name, context)
|
||||||
|
@ -44,44 +36,30 @@ class product_pricelist(report_sxw.rml_parse):
|
||||||
'get_currency': self._get_currency,
|
'get_currency': self._get_currency,
|
||||||
'get_categories': self._get_categories,
|
'get_categories': self._get_categories,
|
||||||
'get_price': self._get_price,
|
'get_price': self._get_price,
|
||||||
'get_quantity':self._get_quantity,
|
|
||||||
'qty_header':self._qty_header,
|
|
||||||
})
|
})
|
||||||
def _qty_header(self,form):
|
|
||||||
def _get_unit_text(obj, cr, uid, par_qty):
|
|
||||||
if form[q]==1:
|
|
||||||
return _('%d unit')%(par_qty)
|
|
||||||
else:
|
|
||||||
return _('%d units')%(par_qty)
|
|
||||||
|
|
||||||
qty=[]
|
def _set_quantity(self,form):
|
||||||
self.pricelist=form['price_list']
|
|
||||||
for i in range(1,6):
|
for i in range(1,6):
|
||||||
q = 'qty%d'%i
|
q = 'qty%d'%i
|
||||||
if form[q]:
|
if form[q]:
|
||||||
self.quantity.append(form[q])
|
self.quantity.append(form[q])
|
||||||
qty.append(_get_unit_text(self, self.cr, self.uid, form[q]))
|
return True
|
||||||
return qty
|
|
||||||
|
|
||||||
|
|
||||||
def _get_quantity(self,form):
|
|
||||||
qty=[]
|
|
||||||
for i in range(1,6):
|
|
||||||
q = 'qty%d'%i
|
|
||||||
if form[q]:
|
|
||||||
qty.append(form[q])
|
|
||||||
return qty
|
|
||||||
def _get_pricelist(self, pricelist_id):
|
def _get_pricelist(self, pricelist_id):
|
||||||
pool = pooler.get_pool(self.cr.dbname)
|
pool = pooler.get_pool(self.cr.dbname)
|
||||||
pricelist = pool.get('product.pricelist').read(self.cr,self.uid,[pricelist_id],['name'])[0]
|
pricelist = pool.get('product.pricelist').read(self.cr,self.uid,[pricelist_id],['name'])[0]
|
||||||
return pricelist['name']
|
return pricelist['name']
|
||||||
|
|
||||||
def _get_currency(self, pricelist_id):
|
def _get_currency(self, pricelist_id):
|
||||||
pool = pooler.get_pool(self.cr.dbname)
|
pool = pooler.get_pool(self.cr.dbname)
|
||||||
pricelist = pool.get('product.pricelist').read(self.cr,self.uid,[pricelist_id],['currency_id'])[0]
|
pricelist = pool.get('product.pricelist').read(self.cr,self.uid,[pricelist_id],['currency_id'])[0]
|
||||||
return pricelist['currency_id'][1]
|
return pricelist['currency_id'][1]
|
||||||
def _get_categories(self, products):
|
|
||||||
|
def _get_categories(self, products,form):
|
||||||
cat_ids=[]
|
cat_ids=[]
|
||||||
res=[]
|
res=[]
|
||||||
|
self.pricelist = form['price_list']
|
||||||
|
self._set_quantity(form)
|
||||||
pool = pooler.get_pool(self.cr.dbname)
|
pool = pooler.get_pool(self.cr.dbname)
|
||||||
pro_ids=[]
|
pro_ids=[]
|
||||||
for product in products:
|
for product in products:
|
||||||
|
@ -98,10 +76,11 @@ class product_pricelist(report_sxw.rml_parse):
|
||||||
'name':product.name,
|
'name':product.name,
|
||||||
'code':product.code
|
'code':product.code
|
||||||
}
|
}
|
||||||
|
i = 1
|
||||||
for qty in self.quantity:
|
for qty in self.quantity:
|
||||||
val[str(qty)]=self._get_price(self.pricelist,product.id,qty)
|
val['qty'+str(i)]=self._get_price(self.pricelist,product.id,qty)
|
||||||
|
i += 1
|
||||||
products.append(val)
|
products.append(val)
|
||||||
|
|
||||||
res.append({'name':cat.name,'products':products})
|
res.append({'name':cat.name,'products':products})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@ -115,42 +94,6 @@ class product_pricelist(report_sxw.rml_parse):
|
||||||
price = self.formatLang(res[0]['list_price'])
|
price = self.formatLang(res[0]['list_price'])
|
||||||
return price
|
return price
|
||||||
|
|
||||||
def repeatIn(self, lst, name, nodes_parent=False,value=[],width=False,type=False):
|
|
||||||
self._node.data = ''
|
|
||||||
node = self._find_parent(self._node, nodes_parent or parents)
|
|
||||||
ns = node.nextSibling
|
|
||||||
if not lst:
|
|
||||||
lst.append(1)
|
|
||||||
for ns in node.childNodes :
|
|
||||||
if ns and ns.nodeName!='#text' and ns.tagName=='blockTable' and len(value) :
|
|
||||||
width_str = ns._attrs['colWidths'].nodeValue
|
|
||||||
ns.removeAttribute('colWidths')
|
|
||||||
if not width or width=='':
|
|
||||||
width=30
|
|
||||||
if type.lower() in ('title'):
|
|
||||||
width=width*len(value)
|
|
||||||
width_str= '%d'%(float(width_str)+width)
|
|
||||||
ns.setAttribute('colWidths',width_str)
|
|
||||||
else:
|
|
||||||
for v in value:
|
|
||||||
width_str +=',%d'%width
|
|
||||||
|
|
||||||
ns.setAttribute('colWidths',width_str)
|
|
||||||
child_list = ns.childNodes
|
|
||||||
for child in child_list:
|
|
||||||
if child.nodeName=='tr':
|
|
||||||
lc = child.childNodes[1]
|
|
||||||
t=0
|
|
||||||
for v in value:
|
|
||||||
newnode = lc.cloneNode(1)
|
|
||||||
if type.lower() in ('string'):
|
|
||||||
newnode.childNodes[1].lastChild.data="[[ %s['%s'] ]]"%(name,v)
|
|
||||||
elif type.lower() in ('label'):
|
|
||||||
newnode.childNodes[1].lastChild.data= "%s"%(v)
|
|
||||||
child.appendChild(newnode)
|
|
||||||
newnode=False
|
|
||||||
return super(product_pricelist,self).repeatIn(lst, name, nodes_parent=False)
|
|
||||||
#end
|
|
||||||
report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist)
|
report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist)
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
||||||
|
|
|
@ -13,103 +13,175 @@
|
||||||
<blockTableStyle id="Table1">
|
<blockTableStyle id="Table1">
|
||||||
<blockAlignment value="LEFT"/>
|
<blockAlignment value="LEFT"/>
|
||||||
<blockValign value="TOP"/>
|
<blockValign value="TOP"/>
|
||||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
|
||||||
<lineStyle kind="GRID" colorName="black"/>
|
<lineStyle kind="GRID" colorName="black"/>
|
||||||
|
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||||
</blockTableStyle>
|
</blockTableStyle>
|
||||||
<blockTableStyle id="Table6">
|
<blockTableStyle id="Table2">
|
||||||
|
<blockAlignment value="LEFT"/>
|
||||||
|
<blockValign value="TOP"/>
|
||||||
|
</blockTableStyle>
|
||||||
|
<blockTableStyle id="Table7">
|
||||||
<blockAlignment value="LEFT"/>
|
<blockAlignment value="LEFT"/>
|
||||||
<blockValign value="TOP"/>
|
<blockValign value="TOP"/>
|
||||||
<blockBackground colorName="#e6e6e6" />
|
|
||||||
<lineStyle kind="GRID" colorName="black"/>
|
<lineStyle kind="GRID" colorName="black"/>
|
||||||
|
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||||
|
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||||
|
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||||
|
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||||
|
<blockBackground colorName="#e6e6e6" start="4,0" stop="4,0"/>
|
||||||
|
<blockBackground colorName="#e6e6e6" start="5,0" stop="5,0"/>
|
||||||
</blockTableStyle>
|
</blockTableStyle>
|
||||||
<blockTableStyle id="Table3">
|
<blockTableStyle id="Table3">
|
||||||
<blockAlignment value="LEFT"/>
|
<blockAlignment value="LEFT"/>
|
||||||
<blockValign value="TOP"/>
|
<blockValign value="TOP"/>
|
||||||
|
</blockTableStyle>
|
||||||
|
<blockTableStyle id="Table5">
|
||||||
|
<blockAlignment value="LEFT"/>
|
||||||
|
<blockValign value="TOP"/>
|
||||||
<lineStyle kind="GRID" colorName="black"/>
|
<lineStyle kind="GRID" colorName="black"/>
|
||||||
</blockTableStyle>
|
</blockTableStyle>
|
||||||
<initialize>
|
<initialize>
|
||||||
<paraStyle name="all" alignment="justify"/>
|
<paraStyle name="all" alignment="justify"/>
|
||||||
</initialize>
|
</initialize>
|
||||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="9.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P1" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P2" fontName="Times-Roman" fontSize="9.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P3" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P4" fontName="Times-Roman" alignment="CENTER"/>
|
<paraStyle name="P4" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P5" fontName="Times-Roman" fontSize="8.0" leading="10"/>
|
<paraStyle name="P5" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P6" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P6" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P7" fontName="Times-Roman" alignment="LEFT"/>
|
<paraStyle name="P7" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P8" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P8" fontName="Times-Roman" fontSize="8.0" leading="10"/>
|
||||||
<paraStyle name="P9" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P9" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P10" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P10" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P11" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P11" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="P12" fontName="Times-Bold" fontSize="8.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="Standard" fontName="Times-Roman" fontSize="12"/>
|
<paraStyle name="P13" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
|
<paraStyle name="P14" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
|
<paraStyle name="P15" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
|
<paraStyle name="P16" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
|
<paraStyle name="P17" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
|
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||||
<paraStyle name="cat" fontName="Times-Bold" textColor="blue" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
|
||||||
</stylesheet>
|
</stylesheet>
|
||||||
<story>
|
<story>
|
||||||
<para style="P5">
|
<para style="P8">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<blockTable colWidths="530.0" repeatRows="1" style="Table1">
|
<para style="P8">
|
||||||
|
<font color="white"> </font>
|
||||||
|
</para>
|
||||||
|
<para style="P8">
|
||||||
|
<font color="white"> </font>
|
||||||
|
</para>
|
||||||
|
<para style="P8">
|
||||||
|
<font color="white"> </font>
|
||||||
|
</para>
|
||||||
|
<para style="P8">
|
||||||
|
<font color="white"> </font>
|
||||||
|
</para>
|
||||||
|
<blockTable colWidths="482.0" style="Table1">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<para style="P8">Products Price List</para>
|
<para style="P2">Products Price List</para>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</blockTable>
|
</blockTable>
|
||||||
<para style="P5">
|
<para style="P8">
|
||||||
<font color="white"> </font>
|
|
||||||
</para>
|
|
||||||
<para style="Standard">
|
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<para style="Standard">Price List Name : [[ get_pricelist (data['form']['price_list']) ]]</para>
|
<blockTable colWidths="117.0,364.0" style="Table2">
|
||||||
<para style="Standard">Currency : [[ get_currency ( data['form']['price_list']) ]]</para>
|
<tr>
|
||||||
<para style="Standard">Printing Date: [[ formatLang(time.strftime('%Y-%m-%d'), date=True) ]]</para>
|
<td>
|
||||||
<para style="P7">
|
<para style="P1">Price List Name:</para>
|
||||||
<font color="white"> </font>
|
</td>
|
||||||
</para>
|
<td>
|
||||||
<section>
|
<para style="P3">[[ get_pricelist(data['form']['price_list']) ]]</para>
|
||||||
<para style="P6">[[repeatIn([],'qty_header',width=59,value=qty_header(data['form']),type='label') ]]</para>
|
</td>
|
||||||
<blockTable colWidths="227.0" style="Table6">
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<para style="P6">Description</para>
|
<para style="P1">Currency :</para>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td>
|
||||||
</blockTable>
|
<para style="P3">[[ get_currency ( data['form']['price_list']) ]]</para>
|
||||||
</section>
|
</td>
|
||||||
<section>
|
</tr>
|
||||||
<para style="Standard">[[ repeatIn(get_categories(objects), 'c',width=59,value=get_quantity(data['form']),type='title') ]]</para>
|
<tr>
|
||||||
<blockTable colWidths="227.0" style="Table3">
|
<td>
|
||||||
<tr>
|
<para style="P1">Printing Date :</para>
|
||||||
<td>
|
</td>
|
||||||
<para style="cat">[[ c['name'] ]]</para>
|
<td>
|
||||||
</td>
|
<para style="P3">[[ formatLang(time.strftime('%Y-%m-%d'), date=True) ]]</para>
|
||||||
</tr>
|
<para style="P4">
|
||||||
</blockTable>
|
<font color="white"> </font>
|
||||||
|
</para>
|
||||||
<section>
|
</td>
|
||||||
<para style="Standard">[[repeatIn(c['products'], 'p',width=59,value=get_quantity(data['form']),type='string') ]]</para>
|
</tr>
|
||||||
<blockTable colWidths="227.0" style="Table3">
|
</blockTable>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<para style="P1">[[ p['code'] and '[' + p['code'] + '] ' or '' ]] [[ p['name'] ]]</para>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</blockTable>
|
|
||||||
</section>
|
|
||||||
</section>
|
|
||||||
<para style="P5"/>
|
|
||||||
<para style="P3">
|
<para style="P3">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
|
<blockTable colWidths="80.0,80.0,80.0,80.0,80.0,80.0" style="Table7">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<para style="P6">Description</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P5">[[str( data['form']['qty1']) ]] units</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P6">[[ str(data['form']['qty2'] )]] units</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P6">[[ str(data['form']['qty3']) ]] units</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P6">[[ str(data['form']['qty4']) ]] units</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P6">[[ str(data['form']['qty5'] ) ]] units</para>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</blockTable>
|
||||||
|
<blockTable colWidths="482.0" style="Table3">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<para style="P17">
|
||||||
|
<font face="Times-Roman">[[repeatIn(get_categories(objects,data['form']), 'c')]][[ c['name'] ]]</font>
|
||||||
|
</para>
|
||||||
|
<blockTable colWidths="79.0,79.0,79.0,79.0,79.0,79.0" style="Table5">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<para style="P12">[[repeatIn(c['products'], 'p')]][[ p['code'] and '[' + p['code'] + '] ' or '' ]] [[ p['name'] ]]</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P7">[[p['qty1'] ]]</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P7">[[ p['qty2'] ]]</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P7">[[ p['qty3'] ]]</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P7">[[ p['qty4'] ]]</para>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<para style="P7">[[ p['qty5'] ]]</para>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</blockTable>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</blockTable>
|
||||||
|
<para style="P1">
|
||||||
|
<font color="white"> </font>
|
||||||
|
</para>
|
||||||
</story>
|
</story>
|
||||||
</document>
|
</document>
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,6 @@
|
||||||
<data>
|
<data>
|
||||||
<wizard id="wizard_close_task" menu="False" model="project.task" name="project.task.close" string="Close Task"/>
|
<wizard id="wizard_close_task" menu="False" model="project.task" name="project.task.close" string="Close Task"/>
|
||||||
<wizard id="wizard_delegate_task" menu="False" model="project.task" name="project.task.delegate" string="Delegate Task"/>
|
<wizard id="wizard_delegate_task" menu="False" model="project.task" name="project.task.delegate" string="Delegate Task"/>
|
||||||
|
<wizard id="wizard_attachment_task" model="project.task" name="project.task.attachment" string="All Attachments"/>
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
import close_task
|
import close_task
|
||||||
import task_delegate
|
import task_delegate
|
||||||
|
import task_attachment
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# OpenERP, Open Source Management Solution
|
||||||
|
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU 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 General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
import wizard
|
||||||
|
import pooler
|
||||||
|
|
||||||
|
'''View the attachments of the parent + children tasks'''
|
||||||
|
|
||||||
|
def _show_attachment(self, cr, uid, data, context):
|
||||||
|
task_obj = pooler.get_pool(cr.dbname).get('project.task')
|
||||||
|
task_browse_id = task_obj.browse(cr, uid, [data['id']], context)[0]
|
||||||
|
attachment_list = [child_id.id for child_id in task_browse_id.child_ids]
|
||||||
|
attachment_list.extend([task_browse_id.parent_id.id])
|
||||||
|
value = {
|
||||||
|
'domain': [('res_model','=',data['model']),('res_id','in',attachment_list)],
|
||||||
|
'name': 'Attachments',
|
||||||
|
'view_type': 'form',
|
||||||
|
'view_mode': 'tree,form',
|
||||||
|
'res_model': 'ir.attachment',
|
||||||
|
'context': { },
|
||||||
|
'type': 'ir.actions.act_window'
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
class wizard_attachment(wizard.interface):
|
||||||
|
states = {
|
||||||
|
'init': {
|
||||||
|
'actions': [],
|
||||||
|
'result': {'type':'action', 'action':_show_attachment, 'state': 'end'},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
wizard_attachment('project.task.attachment')
|
|
@ -880,7 +880,7 @@ class sale_order_line(osv.osv):
|
||||||
pack = self.pool.get('product.packaging').browse(cr, uid, packaging, context)
|
pack = self.pool.get('product.packaging').browse(cr, uid, packaging, context)
|
||||||
q = product_uom_obj._compute_qty(cr, uid, uom, pack.qty, default_uom)
|
q = product_uom_obj._compute_qty(cr, uid, uom, pack.qty, default_uom)
|
||||||
# qty = qty - qty % q + q
|
# qty = qty - qty % q + q
|
||||||
if not (qty % q) == 0 :
|
if qty and (not (qty % q) == 0):
|
||||||
ean = pack.ean
|
ean = pack.ean
|
||||||
qty_pack = pack.qty
|
qty_pack = pack.qty
|
||||||
type_ul = pack.ul
|
type_ul = pack.ul
|
||||||
|
|
Loading…
Reference in New Issue