addons14/account_asset_management/models/account_asset.py
def _group_lines(self, table):
        """group lines prior to depreciation start period."""

        def group_lines(x, y):
            y.update({"amount": x["amount"] + y["amount"]})
            return y

        depreciation_start_date = self.date_start
        lines = table[0]["lines"]
        lines1 = []
        lines2 = []
        flag = lines[0]["date"] < depreciation_start_date
        for line in lines:
            if flag:
                lines1.append(line)
                if line["date"] >= depreciation_start_date:
                    flag = False
            else:
                lines2.append(line)
        if lines1:
            lines1 = [reduce(group_lines, lines1)]
            lines1[0]["depreciated_value"] = 0.0
        table[0]["lines"] = lines1 + lines2
group lines prior to depreciation start period.
group lines prior to depreciation start period.
group lines prior to depreciation start period .
def _group_lines(self, table):
        def group_lines(x, y):
            y.update({"amount": x["amount"] + y["amount"]})
            return y
        depreciation_start_date = self.date_start
        lines = table[0]["lines"]
        lines1 = []
        lines2 = []
        flag = lines[0]["date"] < depreciation_start_date
        for line in lines:
            if flag:
                lines1.append(line)
                if line["date"] >= depreciation_start_date:
                    flag = False
            else:
                lines2.append(line)
        if lines1:
            lines1 = [reduce(group_lines, lines1)]
            lines1[0]["depreciated_value"] = 0.0
        table[0]["lines"] = lines1 + lines2
def _group_lines ( self , table ) : def group_lines ( x , y ) : y . update ( { "amount" : x [ "amount" ] + y [ "amount" ] } ) return y depreciation_start_date = self . date_start lines = table [ 0 ] [ "lines" ] lines1 = [ ] lines2 = [ ] flag = lines [ 0 ] [ "date" ] < depreciation_start_date for line in lines : if flag : lines1 . append ( line ) if line [ "date" ] >= depreciation_start_date : flag = False else : lines2 . append ( line ) if lines1 : lines1 = [ reduce ( group_lines , lines1 ) ] lines1 [ 0 ] [ "depreciated_value" ] = 0.0 table [ 0 ] [ "lines" ] = lines1 + lines2
group lines prior to depreciation start period.
group lines prior to depreciation start period .
"""group lines prior to depreciation start period."""
self
table