[REV] website_crm,website_sale: revert afc9507

The website_crm module doesn't depend on website_sale, so the
salesteam_id field may not exist on website in contactus.

There is clearly a strange overlap with the website salesteam
between website_crm and website_sale, as indicated by the xml_id's.

The previous version didn't crash when the xml_id was not found,
though, while this one would always crash when you try to use
website_crm without website_sale, so I prefer to revert it.

A proper fix would be to set the salesteam at the level of the
website module, but I'm not sure it would make sense considering
that it wouldn't be used at all unless you happen to install one
of those two modules.

In the meantime, I'm reverting afc9507f3a.
This commit is contained in:
David Monjoie
2015-08-17 17:02:09 +02:00
parent 5d18080d3c
commit 8c31ecd368
3 changed files with 2 additions and 7 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ class contactus(http.Controller):
values = {}
values['medium_id'] = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'crm.crm_medium_website')
values['team_id'] = request.website.salesteam_id.id
values['team_id'] = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'website.salesteam_website_sales')
for field_name, field_value in kwargs.items():
if hasattr(field_value, 'filename'):
+1 -1
View File
@@ -574,7 +574,7 @@ class website_sale(http.Controller):
orm_partner.write(cr, SUPERUSER_ID, [partner_id], billing_info, context=context)
else:
# create partner
billing_info['team_id'] = request.website.salesteam_id.id
billing_info['team_id'] = request.registry.get('ir.model.data').xmlid_to_res_id(cr, uid, 'website.salesteam_website_sales')
partner_id = orm_partner.create(cr, SUPERUSER_ID, billing_info, context=context)
# create a new shipping partner
-5
View File
@@ -33,11 +33,6 @@
<field name="member_ids" eval="[(4, ref('base.user_root'))]"/>
<field name="use_quotations" eval="False"/>
</record>
<record model="website" id="website.default_website">
<field name="salesteam_id" ref="website.salesteam_website_sales"/>
</record>
<record id="wlist0" model="website_pricelist">
<field name="selectable" eval="True" />
<field name="website_id" ref="website.default_website" />