fix: adjusted width of colums to see full column names, also fixes #21556

This commit is contained in:
Abhishek Balam 2020-05-10 14:53:59 +05:30
parent 5ec5584319
commit 500dff63e7
2 changed files with 23 additions and 19 deletions

View File

@ -14,21 +14,21 @@ def execute(filters=None):
'fieldname': 'new_customers',
'fieldtype': 'Int',
'default': 0,
'width': 100
'width': 150
},
{
'label': _('Repeat Customers'),
'fieldname': 'repeat_customers',
'fieldtype': 'Int',
'default': 0,
'width': 100
'width': 150
},
{
'label': _('Total'),
'fieldname': 'total',
'fieldtype': 'Int',
'default': 0,
'width': 100
'width': 150
},
{
'label': _('New Customer Revenue'),
@ -52,10 +52,10 @@ def execute(filters=None):
'width': 150
}
]
if filters.get('view_type') == 'Territory Wise':
return get_data_by_territory(filters, common_columns)
else:
if filters.get('view_type') == 'Monthly':
return get_data_by_time(filters, common_columns)
else:
return get_data_by_territory(filters, common_columns)
def get_data_by_time(filters, common_columns):
# key yyyy-mm

View File

@ -20,31 +20,36 @@ def get_columns():
"label": _("Territory"),
"fieldname": "territory",
"fieldtype": "Link",
"options": "Territory"
"options": "Territory",
"width": 150
},
{
"label": _("Opportunity Amount"),
"fieldname": "opportunity_amount",
"fieldtype": "Currency",
"options": currency
"options": currency,
"width": 150
},
{
"label": _("Quotation Amount"),
"fieldname": "quotation_amount",
"fieldtype": "Currency",
"options": currency
"options": currency,
"width": 150
},
{
"label": _("Order Amount"),
"fieldname": "order_amount",
"fieldtype": "Currency",
"options": currency
"options": currency,
"width": 150
},
{
"label": _("Billing Amount"),
"fieldname": "billing_amount",
"fieldtype": "Currency",
"options": currency
"options": currency,
"width": 150
}
]
@ -63,7 +68,6 @@ def get_data(filters=None):
t_opportunity_names = []
if territory_opportunities:
t_opportunity_names = [t.name for t in territory_opportunities]
territory_quotations = []
if t_opportunity_names and quotations:
territory_quotations = list(filter(lambda x: x.opportunity in t_opportunity_names, quotations))