Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2045 Weergaven

i want add a column .

How is that possible.



def _get_columns_name(self, options):
columns = [
{},
{'name': _("Due Date"), 'class': 'date', 'style': 'white-space:nowrap;'},
{'name': _("Journal"), 'class': '', 'style': 'text-align:center; white-space:nowrap;'},
{'name': _("Account"), 'class': '', 'style': 'text-align:center; white-space:nowrap;'},
{'name': _("Exp. Date"), 'class': 'date', 'style': 'white-space:nowrap;'},
{'name': _("As of: %s") % format_date(self.env, options['date']['date_to']), 'class': 'number sortable', 'style': 'white-space:nowrap;'},
{'name': _("1 - 30"), 'class': 'number sortable', 'style': 'white-space:nowrap;'},
{'name': _("31 - 60"), 'class': 'number sortable', 'style': 'white-space:nowrap;'},
{'name': _("61 - 90"), 'class': 'number sortable', 'style': 'white-space:nowrap;'},
{'name': _("91 - 120"), 'class': 'number sortable', 'style': 'white-space:nowrap;'},
{'name': _("Older"), 'class': 'number sortable', 'style': 'white-space:nowrap;'},
{'name': _("Total"), 'class': 'number sortable', 'style': 'white-space:nowrap;'},
]
return columns

Avatar
Annuleer
Beste antwoord

Hello Mohamed,

Hope you are doing well.

If you want to add column then you have to inherit that model in that you want to add column and override the _get_columns_name method and easily add the new column like below.

@api.model
def _get_columns_name(self, options):
columns_names = super(Model, self)._get_columns_name(options)
columns_names.append({'name': _('New Column Name'), 'class': 'number sortable', 'style': 'white-space:nowrap;'})
return columns_names

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
aug. 25
3071
3
feb. 25
4476
0
mei 24
46
1
apr. 24
3929
4
sep. 23
5750