'This method used for creating properties.
:param self: chart templates for which we need to create properties
:param acc_template_ref: Mapping between ids of account templates and real accounts created from them
:param company_id: company_id selected from wizard.multi.charts.accounts.
:returns: True'

@api.multi
def generate_properties(self, acc_template_ref, company):

    self.ensure_one()
    PropertyObj = self.env['ir.property']
    todo_list = [('property_account_receivable_id', 'res.partner', 'account.account'), ('property_account_payable_id', 'res.partner', 'account.account'), ('property_account_expense_categ_id', 'product.category', 'account.account'), ('property_account_income_categ_id', 'product.category', 'account.account'), ('property_account_expense_id', 'product.template', 'account.account'), ('property_account_income_id', 'product.template', 'account.account')]
    for record in todo_list:
        account = getattr(self, record[0])
        value = ((account and ('account.account,' + str(acc_template_ref[account.id]))) or False)
        if value:
            field = self.env['ir.model.fields'].search([('name', '=', record[0]), ('model', '=', record[1]), ('relation', '=', record[2])], limit=1)
            vals = {'name': record[0], 'company_id': company.id, 'fields_id': field.id, 'value': value}
            properties = PropertyObj.search([('name', '=', record[0]), ('company_id', '=', company.id)])
            if properties:
                properties.write(vals)
            else:
                PropertyObj.create(vals)
    stock_properties = ['property_stock_account_input_categ_id', 'property_stock_account_output_categ_id', 'property_stock_valuation_account_id']
    for stock_property in stock_properties:
        account = getattr(self, stock_property)
        value = ((account and acc_template_ref[account.id]) or False)
        if value:
            company.write({stock_property: value})
    return True
