[IMP]sale, crm, stock: set link as a string and brackets at end for product kanaban view

bzr revid: dbr@tinyerp.com-20120427123009-cy4jbia0chiljvjj
This commit is contained in:
DBR (OpenERP) 2012-04-27 18:00:09 +05:30
parent e793701fd5
commit 75c07062f9
4 changed files with 19 additions and 25 deletions

View File

@ -58,14 +58,13 @@
</field>
<xpath expr="//div[@class='oe_partner_desc']//h4[@class='oe_partner_heading']" position="after">
<a name="get_opportunity" type="object">
<t t-if="record.total_oppo.value &lt;= 1">Opportunity</t>
<t t-if="record.total_oppo.value > 1"> Opportunities</t>
(<t t-esc="record.total_oppo.value"/>)
<t t-if="record.total_oppo.value &lt;= 1">Opportunity(<t t-esc="record.total_oppo.value"/>)</t>
<t t-if="record.total_oppo.value > 1">Opportunities(<t t-esc="record.total_oppo.value"/>)</t>
</a>
<a name="%(crm.crm_case_categ_meet)d" type="action">
<t t-if="record.total_meeting.value &lt;= 1">Meeting</t>
<t t-if="record.total_meeting.value > 1">Meetings</t>
(<t t-esc="record.total_meeting.value"/>)
<t t-if="record.total_meeting.value &lt;= 1">Meeting(<t t-esc="record.total_meeting.value"/>)</t>
<t t-if="record.total_meeting.value > 1">Meetings(<t t-esc="record.total_meeting.value"/>)</t>
</a>
</xpath>
</field>

View File

@ -13,9 +13,8 @@
</field>
<xpath expr="//div[@class='oe_partner_desc']//h4[@class='oe_partner_heading']" position="after">
<a name="%(sale.act_res_partner_2_sale_order)d" type="action">
<t t-if="record.total_sale.value &lt;= 1">Quotation</t>
<t t-if="record.total_sale.value > 1">Quotations</t>
(<t t-esc="record.total_sale.value" />)
<t t-if="record.total_sale.value &lt;= 1">Quotation(<t t-esc="record.total_sale.value" />)</t>
<t t-if="record.total_sale.value > 1">Quotations(<t t-esc="record.total_sale.value" />)</t>
</a>
</xpath>
</field>

View File

@ -26,7 +26,7 @@ import decimal_precision as dp
class product_product(osv.osv):
_inherit = "product.product"
def _get_reception(self, cr, uid, ids, field_name, arg, context=None):
def _total_reception(self, cr, uid, ids, field_name, arg, context=None):
total_reception={}
reception_pool=self.pool.get('stock.picking')
for id in ids:
@ -347,7 +347,7 @@ class product_product(osv.osv):
return res
_columns = {
'total_reception': fields.function(_get_reception , type='integer',string="Total Reception"),
'total_reception': fields.function(_total_reception , type='integer',string="Total Reception"),
'total_delivery': fields.function(_total_delivery , type='integer',string="Total Delivery"),
'qty_available': fields.function(_product_available, multi='qty_available',
type='float', digits_compute=dp.get_precision('Product UoM'),
@ -420,6 +420,8 @@ class product_product(osv.osv):
_defaults = {
'valuation': 'manual_periodic',
'total_reception': 0,
'total_delivery': 0,
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):

View File

@ -152,20 +152,14 @@
<li>Price: <field name="lst_price"></field></li>
<li>Cost: <field name="standard_price"></field></li>
</ul>
<t t-if="record.total_reception.raw_value">
<a name="get_receptions" type="object">
(<t t-esc="record.total_reception.value"/>)
<t t-if="record.total_reception.raw_value &lt;= 1">Reception</t>
<t t-if="record.total_reception.raw_value > 1"> Receptions</t>
</a>
</t>
<t t-if="record.total_delivery.raw_value">
<a name="get_deliveries" type="object">
(<t t-esc="record.total_delivery.value"/>)
<t t-if="record.total_delivery.raw_value &lt;= 1">Delivery</t>
<t t-if="record.total_delivery.raw_value > 1">Deliveries</t>
</a>
</t>
<a name="get_receptions" type="object">
<t t-if="record.total_reception.raw_value &lt;= 1">Reception(<t t-esc="record.total_reception.value"/>)</t>
<t t-if="record.total_reception.raw_value > 1">Receptions(<t t-esc="record.total_reception.value"/>)</t>
</a>
<a name="get_deliveries" type="object">
<t t-if="record.total_delivery.raw_value &lt;= 1">Delivery(<t t-esc="record.total_delivery.value"/>)</t>
<t t-if="record.total_delivery.raw_value > 1">Deliveries(<t t-esc="record.total_delivery.value"/>)</t>
</a>
</div>
</div>
<script>