Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1539 มุมมอง

Hi, is there some way I can change the Sales Order reporting graph to use 'Creation Date' as its X axis rather than 'Order Date'?   
I tried to edit the graph with the Studio, but 'Creation Date' is not in the dropdown list for the First Dimension and I cannot enter a manual one as 'order_id.create_date' like I would when making an advanced filter.

Is this possible? 

thanks,

James

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This happens because the create_date field does not exist in the "sale_report" model, which is the model used to create the reports, therefore the "sale_report" model should be inherited from code, add the create_date field and inherit the methods that load the reports. data in the view so that it also loads create_date. (Don't forget to add "sale" to the module dependencies). Then


Inherit model "sale_report" and add field:


class SaleReport(models.Model):  
​_inherit = 'sale.report'

​create_date = fields.Datetime('Order Date', readonly=True)​


The function that loads the data into the view

def _select_sale(self):

In this function you should add a line similar to this:

s.create_date as create_date

You can then edit the chart and change the date field to create_date

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks Pablo, I've passed the info to my developer. It sounds straightforward enough 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
purchase module แก้ไขแล้ว
1
ส.ค. 22
1863
1
มิ.ย. 25
1723
3
ก.ค. 25
3341
1
พ.ค. 25
1489
1
พ.ค. 25
1744