addons14/account_financial_report/report/abstract_report_xlsx.py
def write_line(self, line_object):
        """Write a line on current line using all defined columns field name.
        Columns are defined with `_get_report_columns` method.
        """
        for col_pos, column in self.columns.items():
            value = getattr(line_object, column["field"])
            cell_type = column.get("type", "string")
            if cell_type == "many2one":
                self.sheet.write_string(
                    self.row_pos, col_pos, value.name or "", self.format_right
                )
            elif cell_type == "string":
                if (
                    hasattr(line_object, "account_group_id")
                    and line_object.account_group_id
                ):
                    self.sheet.write_string(
                        self.row_pos, col_pos, value or "", self.format_bold
                    )
                else:
                    self.sheet.write_string(self.row_pos, col_pos, value or "")
            elif cell_type == "amount":
                if (
                    hasattr(line_object, "account_group_id")
                    and line_object.account_group_id
                ):
                    cell_format = self.format_amount_bold
                else:
                    cell_format = self.format_amount
                self.sheet.write_number(
                    self.row_pos, col_pos, float(value), cell_format
                )
            elif cell_type == "amount_currency":
                if line_object.currency_id:
                    format_amt = self._get_currency_amt_format(line_object)
                    self.sheet.write_number(
                        self.row_pos, col_pos, float(value), format_amt
                    )
        self.row_pos += 1
Write a line on current line using all defined columns field name.
        Columns are defined with `_get_report_columns` method.
        
Write a line on current line using all defined columns field name.
Columns are defined with `_get_report_columns` method.
Write a line on current line using all defined columns field name . Columns are defined with ` _get_report_columns ` method .
def write_line(self, line_object):
        for col_pos, column in self.columns.items():
            value = getattr(line_object, column["field"])
            cell_type = column.get("type", "string")
            if cell_type == "many2one":
                self.sheet.write_string(
                    self.row_pos, col_pos, value.name or "", self.format_right
                )
            elif cell_type == "string":
                if (
                    hasattr(line_object, "account_group_id")
                    and line_object.account_group_id
                ):
                    self.sheet.write_string(
                        self.row_pos, col_pos, value or "", self.format_bold
                    )
                else:
                    self.sheet.write_string(self.row_pos, col_pos, value or "")
            elif cell_type == "amount":
                if (
                    hasattr(line_object, "account_group_id")
                    and line_object.account_group_id
                ):
                    cell_format = self.format_amount_bold
                else:
                    cell_format = self.format_amount
                self.sheet.write_number(
                    self.row_pos, col_pos, float(value), cell_format
                )
            elif cell_type == "amount_currency":
                if line_object.currency_id:
                    format_amt = self._get_currency_amt_format(line_object)
                    self.sheet.write_number(
                        self.row_pos, col_pos, float(value), format_amt
                    )
        self.row_pos += 1
def write_line ( self , line_object ) : for col_pos , column in self . columns . items ( ) : value = getattr ( line_object , column [ "field" ] ) cell_type = column . get ( "type" , "string" ) if cell_type == "many2one" : self . sheet . write_string ( self . row_pos , col_pos , value . name or "" , self . format_right ) elif cell_type == "string" : if ( hasattr ( line_object , "account_group_id" ) and line_object . account_group_id ) : self . sheet . write_string ( self . row_pos , col_pos , value or "" , self . format_bold ) else : self . sheet . write_string ( self . row_pos , col_pos , value or "" ) elif cell_type == "amount" : if ( hasattr ( line_object , "account_group_id" ) and line_object . account_group_id ) : cell_format = self . format_amount_bold else : cell_format = self . format_amount self . sheet . write_number ( self . row_pos , col_pos , float ( value ) , cell_format ) elif cell_type == "amount_currency" : if line_object . currency_id : format_amt = self . _get_currency_amt_format ( line_object ) self . sheet . write_number ( self . row_pos , col_pos , float ( value ) , format_amt ) self . row_pos += 1
Write a line on current line using all defined columns field name.
Write a line on current line using all defined columns field name .
"""Write a line on current line using all defined columns field name.
        Columns are defined with `_get_report_columns` method.
        """
self
line_object