[Erp5-users] setter for sourceSection

Ignatius Kunjumon ignatius.kunjumon at gmail.com
Tue Apr 13 07:05:59 CEST 2010


how to redefine "source section" setter

my function  "setSoureSection"  is not calling when i change the source
section value
i can call this function directly from the URL

pl see the attached file for complete code
#############################################################

 def setSourceSection(self, value=None):
        """
        """
        self.source_section = value
        self.calBalanceAvalibleInBudget()
        return

 def calBalanceAvalibleInBudget(self):
        """ Budget Balance
        """
        catalog = getToolByName(self, 'portal_catalog')

        uid1 = self.getSourceSectionUid()
        result = catalog(uid=uid1)
        if not len(result):
                self.setBalanceAvalibleInBudget(0)
                return 0
        obj = result[0].getObject()
        #obj.calBalanceAmount()
        val = obj.getBalanceAmount()
        if not val:
                self.setBalanceAvalibleInBudget(0)
                return 0
        out = int(val)
        self.setBalanceAvalibleInBudget(out)
        return out
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.tiolive.com/pipermail/erp5-users/attachments/20100413/f5732372/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bill.py
Type: text/x-python
Size: 9473 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-users/attachments/20100413/f5732372/attachment.py>


More information about the Erp5-users mailing list