Website mailing list archives

website@odoo-community.org

Avatar

Re: Website registration - Company goes to address field

by
Kaloyan Naumov
- 06/10/2016 15:32:38

FYI:

A quick look at the functionality in odoo10, shows that it's made in a simpler and nice manner:

1. A new field in res_partner is created - “company_name”. 
2. in the website, the data from field company is sent to “company_name”. It’s still creates an individual contact.
a) Name is set as in the form
b) Display Name is set as: "Company123, Person Name”, as if company
c) VAT is set to the Individual
3. In the Back Office in res.partner.form (base.view_partner_form)
They have enhanced it as:
<div class="o_row">
<field name="parent_id" placeholder="Company" domain="[('is_company', '=', True)]" context="

{'default_is_company': True, 'default_supplier': supplier, 'default_customer': customer}

" attrs="

{'invisible': ['|', '&', ('is_company','=', True),('parent_id', '=', False),('company_name', '!=', False),('company_name', '!=', '')]}

"/>
<field name="company_name" attrs="

{'invisible': ['|', '|', ('company_name', '=', False), ('company_name', '=', ''), ('is_company', '=', True)]}

"/>
<button name="create_company" type="object" string="Create company" class="btn btn-sm oe_edit_only fa fa-external-link btn btn-link " attrs="

{'invisible': ['|', '|', ('is_company','=', True), ('company_name', '=', ''), ('company_name', '=', False)]}

"/>
</div>

4. After clicking the "Create Company" Action in the Back Office form, the data from “company_name" is deleted and they copy all of the available contact details, address, language to new company record and associate the individual contact to the company. 


In Odoo v10 there's a bug that the VAT filed get's lost in the transition (from both individual and company ), but that's fixable - it's better to copy the VAT too. There’s also one more new related field in v10, which is “commercial_company_name”, which after creating the company stores the value from “company_name", but it’s out of scope for v9.



Done like this, it’s easy to improve v9 behaviour with a module. 


Kind Regards,
Kaloyan Naumov
+359 898 27 89 44
kaloyan@lumnus.net

On Sep 28, 2016, at 9:23 PM, Pedro M. Baeza (Tecnativa) <pedro.baeza@tecnativa.com> wrote:

Hi, Kaloyan,

What I would do is to create a parent partner with company data and a children res.partner with the contact specific data (the contact name and not too much). Another improvement would the management child accounts for the same company from the website portal itself.

Regards.

2016-09-28 17:38 GMT+02:00 Kaloyan Naumov <kaloyan@lumnus.net>:
Hello,

there is this “strange” behaviour, Odoo decided to keep for v8 & v9, that is: Portal User Registrations, user’s company field goes to Address2.

There are several issue reports on the topic:

Odoo’s statement is that they will fix it it v10, as part of a major improvement of the e-commerce modules. v8 & 9 are being left behind with this unfixed.

Practically, as is, it’s better to disallow business user account creation (hide the fields) from the Website, and that’s a No Go for B2B operations.

Is there any OCA effort to deal with this in v8 & v9? If not, would anyone be willing to advise on a proper approach of doing it in a correct, or a not-as-bad manner?



Kind Regards,
Kaloyan Naumov
+359 898 27 89 44
kaloyan@lumnus.net

_______________________________________________
Mailing-List: http://odoo-community.org/groups/website-36
Post to: mailto:website@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


_______________________________________________
Mailing-List: http://odoo-community.org/groups/website-36
Post to: mailto:website@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


Reference