[Erp5-dev] Setting operation (or any other category) as resource on Invoice Line is a problem...?
Jérome Perrin
jerome at nexedi.com
Tue Nov 6 19:18:17 CET 2007
Łukasz Nowak a écrit :
> Hello,
>
> Invoice has resource set to price_currency (title: Polski Zloty).
>
> If Product (title: product) is set as resource on Invoice Line then:
>
> - invoice_line.getResourceValue -> Product
> - invoice_line.getResource -> product_module/1
> - invoice_line.getResourceTitle -> product
>
> But when category operation (title: operation_title) is set on resource:
>
> - invoice_line.getResourceValue -> operation
> - invoice_line.getResource -> operation/operation
> - invoice_line.getResourceTitlte -> Polski Zloty - which is wrong
>
> Is it a bug/feature/configuration problem?
hello,
resource_title is not a standard accessor. This is in property sheet
Amount.py :
{ 'id' : 'resource_title',
'description' : "The resource title involved",
'type' : 'string',
'acquisition_base_category' : ('resource',),
'acquisition_portal_type' : Expression('python:
portal.getPortalResourceTypeList()'),
'acquisition_copy_value' : 0,
'acquisition_mask_value' : 0,
'acquisition_sync_value' : 0,
'acquisition_accessor_id' : 'getTitle',
'acquisition_depends' : None,
'alt_accessor_id' : ('_categoryGetResourceTitle', ),
'mode' : 'w' },
This means that getResourceTitle accessor is somehow equivalent to
getResourceValue(portal_type=portal.getPortalResourceTypeList()).getTitle()
'operation' is a Category, which is not in resource portal type group.
The question is: do we still need this property definition ?
This property sheet is here since the first revision, I guess it was
added because at that time 'title' accessors were not generated for
categories.
Jérome
More information about the Erp5-dev
mailing list