From 61f249a49547cbf4dbafa757c6f0cc21ffd0d475 Mon Sep 17 00:00:00 2001 From: RomainLibert Date: Tue, 4 Sep 2018 16:54:08 +0200 Subject: [PATCH] [IMP] crm, website_sale: change create date of demo datas In order to have some data to display in the dashboard views, we need to set the create_date of the crm.lead and sale.order so that they are not all created today. We can now set the create date directly in the demo data, so we remove the hack that was previously used in website_sale --- addons/crm/data/crm_lead_demo.xml | 53 ++++++++++++++++++++++++ addons/website_sale/data/demo.xml | 13 +++--- addons/website_sale/models/sale_order.py | 6 --- 3 files changed, 60 insertions(+), 12 deletions(-) diff --git a/addons/crm/data/crm_lead_demo.xml b/addons/crm/data/crm_lead_demo.xml index 07d520f09d6..28d9720086d 100644 --- a/addons/crm/data/crm_lead_demo.xml +++ b/addons/crm/data/crm_lead_demo.xml @@ -38,6 +38,7 @@ + lead Club Office Furnitures Jacques Dunagan @@ -73,6 +74,7 @@ + lead Design Software Marc Dufour @@ -104,6 +106,7 @@ + lead Pricing for 25 desks John Miller @@ -126,6 +129,7 @@ + lead Campbell: Chairs Henry Campbell @@ -147,6 +151,7 @@ + lead Quotation for 50 Chairs Carrie Helle @@ -187,6 +192,7 @@ Contact: +1 813 494 5005

]]>
+ lead Opensides: Need Info Tina Pinero @@ -207,6 +213,7 @@ Contact: +1 813 494 5005

]]>
+ lead Gardner: Desks Replacement Wendi Baltz @@ -228,6 +235,7 @@ Contact: +1 813 494 5005

]]>
+ lead Product Catalog Logan @@ -262,6 +270,7 @@ ESM Expert
]]>
+ lead Reseller: Office furnitures Delisle Albert @@ -282,6 +291,7 @@ ESM Expert
]]>
+ lead Design Software Info Jose Garcia @@ -315,6 +325,7 @@ Andrew

]]>
+ lead Estimation for Office Furnitures Thomas Passot @@ -336,6 +347,7 @@ Andrew

]]>
+ lead Quotation for 100 Desks Bojing Hú @@ -361,6 +373,7 @@ Andrew

]]>
+ opportunity Quote for 600 Chairs 40000 @@ -383,6 +396,7 @@ Andrew

]]>
+ opportunity Office Design Project 7 @@ -408,6 +422,7 @@ Andrew

]]>
+ opportunity Info about services 25000 @@ -493,6 +508,7 @@ Andrew

]]>
+ opportunity Global Solutions: Furnitures 3800 @@ -515,6 +531,7 @@ Andrew

]]>
+ opportunity Balmer Inc: Potential Distributor 1000 @@ -548,6 +565,7 @@ Andrew

]]>
+ opportunity DeltaPC: 10 Computer Desks @@ -592,6 +610,7 @@ Andrew

]]>
+ opportunity Customizable Desk 3 @@ -619,6 +638,7 @@ Andrew

]]>
+ opportunity Distributor Contract 19800 @@ -640,6 +660,7 @@ Andrew

]]>
+ opportunity Office Design and Architecture 9000 @@ -659,6 +680,7 @@ Andrew

]]>
+ opportunity 5 VP Chairs 5600 @@ -677,6 +699,7 @@ Andrew

]]>
+ opportunity Access to Online Catalog 2000 @@ -693,6 +716,7 @@ Andrew

]]>
+ opportunity Need 20 Desks 60000 @@ -711,6 +735,7 @@ Andrew

]]>
+ opportunity Modern Open Space 4500 @@ -733,6 +758,7 @@ Andrew

]]>
+ opportunity Open Space Design 11000 @@ -756,6 +782,7 @@ Andrew

]]>
+ opportunity Interest in your products 2000 @@ -775,6 +802,32 @@ Andrew

]]>
+ + + opportunity + Furnish a 60m² office + 7500 + 20 + Deco Addict + info@agrolait.com + + + Wavre + 1300 + Rue de Namur 69 + 0 + + + + + + + + + + + @@ -317,6 +318,7 @@
+ @@ -338,6 +340,7 @@ + @@ -359,6 +362,7 @@ + @@ -380,6 +384,7 @@ + @@ -401,6 +406,7 @@ + @@ -422,6 +428,7 @@ + @@ -575,10 +582,4 @@ - - - - - diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 4c586b404ac..476f0405e2b 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -234,12 +234,6 @@ class SaleOrder(models.Model): }, } - def _set_demo_create_date(self, create_date): - self.env.cr.execute("""UPDATE sale_order SET create_date=%s WHERE id IN %s """, (create_date, tuple(self.ids))) - self.modified(['create_date']) - if self.env.recompute and self.env.context.get('recompute', True): - self.recompute() - class SaleOrderLine(models.Model): _inherit = "sale.order.line"