Git Product home page Git Product logo

partner-contact's Introduction

Runboat Pre-commit Status Build Status codecov Translation Status

Partner Contact

Contact-related odoo addons.

Available addons

addon version maintainers summary
account_partner_company_group 16.0.1.0.0 Adds the possibility to add a company group to a company
base_country_state_translatable 16.0.1.0.0 Translate Country States
base_location 16.0.1.0.1 pedrobaeza Enhanced zip/npa management system
base_location_geonames_import 16.0.1.0.0 Import zip entries from Geonames
base_location_nuts 16.0.1.0.0 rafaelbn edlopen NUTS Regions
base_partner_company_group 16.0.1.0.0 Adds the possibility to add a company group to a company
base_partner_sequence 16.0.1.1.0 Sets customer's code from a sequence
crm_partner_company_group 16.0.1.0.0 Adds the possibility to add a company group to a company
partner_accreditation 16.0.1.0.0 victor-champonnois Add Accreditation to Partners
partner_address_split 16.0.1.0.0 Add specific helper methods
partner_address_street3 16.0.1.0.0 Add a third address line on partners
partner_affiliate 16.0.1.0.0 Partner Affiliates
partner_auto_archive 16.0.1.0.0 Archive periodically all contacts marked as auto-archive.
partner_bank_acc_type_constraint 16.0.1.0.1 alexis-via Adds constraint on bank account type
partner_bank_code 16.0.1.0.1 Add fields information in banks
partner_capital 16.0.0.1.1 EmilioPascual Partners Capital
partner_category_security 16.0.2.0.1 victoralmau Partner category security
partner_category_security_crm 16.0.1.0.0 victoralmau Partner category security (crm extension)
partner_category_type 16.0.1.0.0 JordiMForgeFlow Add a selection field 'Type' to classify Contact Tags.
partner_company_default 16.0.1.1.1 Partner Company Default
partner_company_group 16.0.1.0.0 luisg123v Adds the possibility to add a company group to a company
partner_company_type 16.0.1.0.0 Adds a company type to partner that are companies
partner_contact_access_link 16.0.1.1.0 Yajo Allow to visit the full contact form from a company
partner_contact_address_default 16.0.1.1.0 Set a default delivery address, invoice address and contact for contacts
partner_contact_age_range 16.0.1.0.1 Age Range for Contact's
partner_contact_birthdate 16.0.1.0.0 Contact's birthdate
partner_contact_department 16.0.1.0.2 Assign contacts to departments
partner_contact_gender 16.0.1.0.0 Add gender field to contacts
partner_contact_job_position 16.0.1.0.0 Categorize job positions for contacts
partner_contact_lang 16.0.1.0.0 Manage language in contacts
partner_contact_nationality 16.0.1.0.1 Add nationality field to contacts
partner_contact_personal_information_page 16.0.1.0.1 Add a page to contacts form to put personal information
partner_contact_type_end_user 16.0.1.0.0 rousseldenis Adds a new contact type 'End User'
partner_country_state_required 16.0.1.0.0 Partner Country State Required
partner_deduplicate_acl 16.0.1.0.1 Contact deduplication with fine-grained permission control
partner_deduplicate_by_ref 16.0.1.0.0 Deduplicate Contacts by reference
partner_deduplicate_filter 16.0.1.0.0 Exclude records from the deduplication
partner_disable_gravatar 16.0.1.0.1 alexis-via Disable automatic connection to gravatar.com
partner_display_name_line_break 16.0.1.1.0 Split the company and the partner name on two different lines
partner_email_check 16.0.1.0.0 Validate email address field
partner_email_duplicate_warn 16.0.1.0.0 alexis-via Warning banner on partner form if another partner has the same email
partner_employee_quantity 16.0.1.0.1 pedrobaeza rafaelbn edlopen Know how many employees a partner has
partner_external_map 16.0.1.0.0 Add Map and Map Routing buttons on partner form to open GMaps, OSM, Bing and others
partner_fax 16.0.1.0.0 Add fax number on partner
partner_firstname 16.0.1.0.3 Split first name and last name for non company partners
partner_identification 16.0.1.0.3 Partner Identification Numbers
partner_identification_eori 16.0.1.0.0 This addon extends "Partner Identification Numbers" to provide a number category for EORI Number
partner_identification_gln 16.0.1.0.1 This addon extends "Partner Identification Numbers" to provide a number category for GLN registration
partner_industry_secondary 16.0.1.0.1 Add secondary partner industries
partner_interest_group 16.0.1.2.0 victor-champonnois Add Interest Group to Partners
partner_label 16.0.1.0.0 Print partner labels
partner_lastname_uppercase 16.0.1.0.1 Uppercases the the last names of partners
partner_manual_rank 16.0.1.1.2 luisg123v frahikLV Be able to manually flag partners as customer or supplier.
partner_middlename 16.0.1.0.0 Have split Middle
partner_mobile_duplicate_warn 16.0.1.0.0 alexis-via Warning banner on partner form if another partner has the same mobile
partner_multi_relation 16.0.1.0.1 Partner Relations
partner_phonecall_schedule 16.0.1.0.1 Track the time and days your partners expect phone calls
partner_pricelist_search 16.0.1.0.0 Partner pricelist search
partner_purchase_manager 16.0.1.0.1 EmilioPascual Add purchase manager field in partner
partner_ref_unique 16.0.1.0.0 Add an unique constraint to partner ref field
partner_second_lastname 16.0.1.0.2 Have split first and second lastnames
partner_stage 16.0.1.0.1 dreispt Add lifecycle Stages to Partners
partner_subject_to_vat 16.0.1.0.0 victor-champonnois Record whether a company is subject to VAT.
partner_tier_validation 16.0.1.0.1 dreispt Support a tier validation process for Contacts
partner_tz 16.0.1.0.0 Remove partner timezone default value and display on form
partner_vat_unique 16.0.1.0.0 Module to make the VAT number unique for customers and suppliers.
purchase_supplier_rank 16.0.1.0.1 Update Supplier Rank when creating a Purchase Order
sale_customer_rank 16.0.1.0.0 Update Customer Rank when creating a Sale Order
sale_partner_company_group 16.0.1.0.0 Adds the possibility to add a company group to a company

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

partner-contact's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

partner-contact's Issues

Port MPs from launchpad to here

  • Move what you have write access to. E.g. I can move savoirfairelinux branches
  • Provide links to the lp porting guide for OCA on the MRs which are still open
  • Rate resubmit and reject the MRs
  • Merge missing commits

[8.0] partner_relations

File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/2947363-8-0-f99b1d/openerp/addons/partner_relations/model/res_partner_relation_all.py", line 187, in write
    underlying_objs.type_selection_id.id
AttributeError: 'list' object has no attribute 'type_selection_id'

Use case:

  1. Create two relations for Company-Company ('Is competitor of' and 'Representative')
  2. Go to a Partner and create a relation with another partner
  3. Save
  4. Edit the created relation and change 'Relation Type' column
  5. Save

NOTE: If you select the inverse relation of the current relation, bug doesn't appear

Is this the expected behavior?

  • If yes, then 'Relation Type' domain must be more restrictive in order to avoid user to select a bad relation type
  • If not, write method must support this use case

Thanks for your support

Deprecate base_contact and split it in other modules

After discussion in #118, it became clear that the current implementation of base_contact is not what its name suggests (a base for contact modules), but a collection of unrelated functionalities that remain from old times and block further development.

So, my suggestion is:

  1. Create a new base module for contact stuff. It will just have a sheet called Personal data that will display only for contact partners. It's intended to serve as a base for other modules, so it will do nothing more. Let's call it contact_base.
  2. Split the functionalities from base_contact in 3 modules:
    1. contact_in_several_partners: set several job positions in different companies per contact.
    2. contact_birthdate.
    3. contact_nationality.
  3. Deprecate base_contact, making it a dummy module that depends on those 3 new modules. This way, after next update all will continue working as it did before.
  4. Remove base_contact whenever branch 9.0 appears.

After all that is done, new modules for contact personal data may come easier. I myself will submit some: contact gender, disability, and some others just for the l10n-spain team.

My company needs all these changes, so I'll start working on this right now unless somebody tells me they are already doing it or have a better roadmap for those modules. I don't mind having our own fork forever if nobody wants these changes, but I think this work will benefit everyone, so I'd prefer to have approval from the community and give back a little of the help we have received and appreciate so much.

[base_contact] 'pop' not supported on frozendict on _basecontact_check_context

In latest 8.0 branch, there was a change on how context is handled, as now it is a frozendict, so context.pop() raises

  'pop' not supported on frozendict on _basecontact_check_context

Just add

    context = dict(context or {})

at the beginning of _basecontact_check_context to fix it...

Anyway, seems like a standard procedure to do that whenever context.pop() is required, so it helps to other versions besides 8.0...

Still learning git, so I am not sure how to create the MP (or whatever it is called now on git)...

Bad compare onchange_type_selection_id

On line 169 of res_partner_relation_all.py
is_company = self.type_selection_id.partner_category_other == 'c'

It gives apples/oranges python error...

Not sure what this is supposed to do, it is getting a category but the 'c', 'p' portions of this module are for the is_company flag. I commented and removed the filter and it now works, but it would be nice of setting the relationship type filtered the right partner dropdown.

[8.0] partner_firstname, name with store=True are not recompute during the copy

This error is only view with the res.users.

FAIL: test_copy_user (partner_firstname.tests.test_partner_firstname.test_partner_firstname)

Traceback (most recent call last):
File "/Users/jssuzanne/openerp/sensee/ecommerce/partner_contact/partner_firstname/tests/test_partner_firstname.py", line 94, in test_copy_user
'Copy of the user failed with wrong name'
AssertionError: u'lastname firstname firstname' != 'lastname (copy) firstname' : Copy of the user failed with wrong name

launch with the anybox.testing.openerp. I saw that the name is removed of the default values in the method copy_data. But the name must be force to None to be recompute, because with store=True the fields.function isn't be recompute.

Names order configuration options

Hi everyone,

We want to add a new feature in OCA/partner-contact: Odoo admin configures partner names orders when partner_firstname or partner_second_lastname addons are installed

We have two ways to do it:

  1. Add this feature in partner_firstname and partner_second_lastname addons
  2. Make two addons that add this feature:
    • partner_firstname_order
    • partner_second_lastname_order

I prefer the first way

BTW, there are several ways to allow Odoo admin to configure names order, for example with a partner: María José Espinosa de los Monteros we will have this:

  • firstname: María José
  • lastname: Espinosa
  • second_lastname: de los Monteros

We can allow these possible configurations:

  • last_first (default because it is the current behavior): Espinosa de los Monteros María José
  • first_last: María José Espinosa de los Monteros
  • last_first_coma: Espinosa de los Monteros, María José

An we have several ways to configure this:

  1. Selection list in res.company: Then all partner in this company share this name order.
  2. Selection list in Settings > Configuration > Sales: Then all partners in all companies of this Odoo instance share this name order
  3. Selection list in res.partner: Then each partner can select the order he wants and we can define a default order in res.company or Settings > Configuration > Sales.

I propose 1, because I think it should be a company policy.

We can add a migration script in order to migrate all instances to the default configuration (last_first).

Any opinion or suggestion?

Standalone Contact address not inherited from the original contact

Tested modules partner_contact_in_several_companies and res_partner_affiliate and wonder whether following is designed feature or a bug:
I have two companies, company A being the 'mother company' and company B and C the daughters or affiliates. Company A is having centralized invoicing department (Contact of type invoice address in company A data) which is used by B and C. I maintain a special invoicing address for the A invoicing department, which is different to the company A regular visiting address. I'd like to use the A invoicing dept. address as the invoice address when company B and C are creating sales orders and invoices. However, when I create invoice for B and C I get company A company visiting address to the invoice, not the A's invoicing department address as I would expect.

Further, if you would change the invoicing dept. address at some point I would like to change only one address and after that being able to invoice for company B and C with the updated invoicing address data and avoid to update also addresses behind B and C customers.

[8.0][partner_firstname] Issue when changing partner in event

Description of the issue

I have an error when changing the partner on a registration, visible on the server, and in the UI, the list of followers become empty.
This also blocks any attempt to do other onchange or @api.depend on the event.registration.

How to reproduce

I used the following :

I start the server, create a new database with demo values, then install the event and partner_firstname.
I log on the interface, go to marketing/registration and click on one of the object to go in form view. I click edit and change the partner to another. The list of followers, which was Administrator, is emptied and there is this error message on the server:

2016-04-06 15:21:53,981 17957 ERROR event_test openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/home/vhatakeyama/src/odoo8/openerp/http.py", line 539, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/vhatakeyama/src/odoo8/openerp/http.py", line 576, in dispatch
    result = self._call_function(**self.params)
  File "/home/vhatakeyama/src/odoo8/openerp/http.py", line 312, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/vhatakeyama/src/odoo8/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/vhatakeyama/src/odoo8/openerp/http.py", line 309, in checked_call
    return self.endpoint(*a, **kw)
  File "/home/vhatakeyama/src/odoo8/openerp/http.py", line 805, in __call__
    return self.method(*args, **kw)
  File "/home/vhatakeyama/src/odoo8/openerp/http.py", line 405, in response_wrap
    response = f(*args, **kw)
  File "/home/vhatakeyama/src/odoo8/addons/web/controllers/main.py", line 944, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/vhatakeyama/src/odoo8/addons/web/controllers/main.py", line 936, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/home/vhatakeyama/src/odoo8/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/vhatakeyama/src/odoo8/addons/mail/mail_thread.py", line 187, in read_followers_data
    for follower in self.pool.get('res.partner').browse(cr, uid, follower_ids, context=context):
  File "/home/vhatakeyama/src/odoo8/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/vhatakeyama/src/odoo8/openerp/models.py", line 5265, in browse
    return self._browse(Environment(cr, uid, context or {}), ids)
  File "/home/vhatakeyama/src/odoo8/openerp/models.py", line 5258, in _browse
    env.prefetch[cls._name].update(ids)
TypeError: unhashable type: 'list'

This error does not happen with this older version 69cbd81.

base_contact improvement: add ISO codes

Currently res.country already contains "ISO 3166-1 alpha-2" country code. (see http://en.wikipedia.org/wiki/ISO_3166-1)

It may be interesting to:

We are willing to contribute with it to OCA, but two questions arise:

  • Is it interesting enough for OCA? (I believe so, as it spans every country)
  • Where to make the enhancements: in base_location or new module(s)?

[7.0, 8.0] The transient model base.partner.merge.line should not have explicit access rules

If someone wants to contribute, the access rules for base.partner.merge.line need to be removed for both 7.0 and 8.0

2014-07-19 15:47:03,203 19329 WARNING openerp_test openerp.modules.loading: The transient model base.partner.merge.line (base.partner.merge.line) should not have explicit access rules!

2014-07-19 15:47:03,203 19329 WARNING openerp_test openerp.modules.loading: The transient model base.partner.merge.automatic.wizard (base.partner.merge.automatic.wizard) should not have explicit access rules!

[partner_firstname] init script performance issue

partner_firstname: 8.0

The initialization script (partner_firstname/data/res_partner.yml) took several hours to process a large amount of partners (in excess of 100k in my case).

I was able to replicate most of the script's functionality using a couple SQL statements which took only a few seconds to run.
It is my belief that the script's performance can be significantly improved without too much work simply by using SQL statements where appropriate.

Here are the SQL queries I used. Note that unlike the script in res_partner.yml, these statements will recompute firstname, lastname for all records, including those where these values are already populated.

BEGIN;
-- Trim 'name'
UPDATE res_partner
SET name = trim(both ' ' from regexp_replace(name, '\s+', ' '))
;

-- Compute 'name'
UPDATE res_partner
SET lastname  = trim(both ' ' from substring(trim(both ' ' from name) from '^\S*\s')),
    firstname = trim(both ' ' from substring(trim(both ' ' from name) from '\s.*$'))
;
COMMIT;

Modulo base_location improvement discussion

Hi!

I'm analyzing the base_location module, and I noticed with my customers that the better_zip field is cool but in the actual implementation is "redundant" in tha partner profile as you can see in the image below:

screenshot 2014-09-22 13 23 59

The city, zip, state and country information is proposed twice and in my opinion is not the best choice.

So what do you think to remove the m2o field and put a button with a function that set the right parameter in the res.partner?

What do you think about?

My 2 cents

Regards

Franco

[partner_firstname] can't rename partner if company in v7

Using Partner_firstname.
I could not rename partners if they are a company.

I had to change the return of function _write_name from:
return self.write(cursor, uid, partner_id, vals, context=context)
to:
return self.write(cursor, uid, [partner_id], vals, context=context)

Open in map App on smartphone

module: partner_external_map
version: 9.0

Steps to reproduce

  • Using android phone click on map button

Current behavior
First time popup gets blocked by browser, when allowed it asks if I want to open with map app and gives me possible choices of apps I can use (GREAT!)
From that point on, when clicked it just opens it in a new tab of the browser, no choice to use an app.

Expected behavior
Would be great if on a smartphone I could choose to use a navigation app as it would be with a normal link to a map, because this is a redirect it doesn't work that way.

[8.0] partner_relations - Error when deleting a res.partner

Tested in OCA's runbot
https://runbot.odoo-community.org/runbot/repo/github-com-oca-partner-contact-134

  • Create a partner
  • Don't select "is a company"
  • Filled "firstname" and "lastname"
  • Save partner
  • Delete the partner we have created
  • You get this error:

AccessError
No value found for res.partner(75,).birthdate_date

I have tested in Odoo's runbot and you can delete any res.partner if it hasn't any other relation with other objects.

Maybe this bug it not from this module partner_contact_birthdate

@pedrobaeza I think that any module in this project must at least pass test of creating, modifying and deleting a res.partner, if not shouldn't be merged.

cc @sysadminmatmoz @yajo

[8.0] [partner_create_by_vat] Odoo Server Error

I've done all the steps required to install this module, including installing python-stdnum
But when I create a new partner, click on is_company True, write the VAT number and click on "Get Vies Data", Odoo raises a server error:

_Odoo Server Error
File "/opt/odoo/partner-contact/partner_create_by_vat/models/res_partner.py", line 26, in get_vies_data
result = check_vies(vat)
NameError: global name 'check_vies' is not defined

I've tried with several VAT's and nothing seems to work, ¿what am I doing wrong?

Thank you

[8.0] partner_firstname Error when creating a partner with is_company set to True

module: partner_firstname
version: 8.0

Steps to reproduce

Creating tests in module partner_create_by_vat, i set only name and is_company set to True, at launching tests locally, or without the partner_firstname everything is ok, when i launch the tests with the partner firstname, it raises error about EmptyNames

Current behavior

The create method is inherited in the partner_firstaname module, after computin firstname and lastname (the name of the company if is_comoany set to True), the "name" key and value is deleted from the vals, but after the _inverse_name function is called, so without having the "name" in vals, firstname and lastname are set to False.

Expected behavior

Not to raise error.

base_partner_merge v7 destroys database when it is uninstalled

Affects v7

When base_partner_merge is uninstalled it drops the partner.id column from the database. Consequently, all the foreign keys are lost and the database is inaccessible. You need to restore the whole environment.
The problem is that the module inherits the class res_partner and adds the column “id”. When the module is uninstalled it drops the column “id” from the res_partner model and also from the database

[9.0]partner_firstname: when additionally installing leave management (hr_holidays), Odoo crashes

When I try to install leave management (hr_holidays) with the module partner_firstname already installed, Odoo gets an infinite loop with the following log:

2016-04-03 13:39:43,684 1311 ERROR imestis werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
execute(self.server.app)
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/openerp/service/server.py", line 245, in app
return self.app(e, s)
File "/usr/lib/python2.7/dist-packages/openerp/service/wsgi_server.py", line 184, in application
return application_unproxied(environ, start_response)
File "/usr/lib/python2.7/dist-packages/openerp/service/wsgi_server.py", line 170, in application_unproxied
result = handler(environ, start_response)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1488, in call
return self.dispatch(environ, start_response)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1462, in call
return self.app(environ, start_wrapped)
File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 579, in call
return self.app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1637, in dispatch
ir_http = request.registry['ir.http']
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 360, in registry
return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 355, in get
update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 340, in load_modules
registry.setup_models(cr)
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 197, in setup_models
model._setup_base(cr, SUPERUSER_ID, partial)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, _args, *_kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 354, in old_api
result = method(recs, _args, *_kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3025, in _setup_base
self.env[parent]._setup_base(partial)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, _args, *_kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 2995, in _setup_base
field = cls0._fields[name]
KeyError: 'lastname'

base_partner_merge duplicated with Odoo crm module

I noticed that the base_partner_merge module is duplicated with the official crm module which includes this wizard. They share the same model name, views, etc. so it produces weird effects when both are installed. The code seems roughly the same (it was a backport originally) but I didn't checked if we have patches on this module to push upstream (at least #182 and #183 I guess).

Should we remove this module?

Migration to version 9.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-9.0

Modules to migrate

base_partner_merge error in v7

Affects version 7.0

When two customers are merged having both customer invoices, the module does the work but after that at customer invoices menu the system gives an error.

It is due to the field account_invoice.commercial_partner_id that is not updated and keeps the old customer, that is actually deleted.

ERROR:

Client Traceback (most recent call last):
File "/opt/openerp/server/openerp/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1054, in search_read
return self.do_search_read(req, model, fields, offset, limit, domain, sort)
File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1089, in do_search_read
records = Model.read(ids, fields or False, req.context)
File "/opt/openerp/server/openerp/addons/web/session.py", line 42, in proxy
result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
File "/opt/openerp/server/openerp/addons/web/session.py", line 30, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/opt/openerp/server/openerp/addons/web/session.py", line 103, in send
raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
File "/opt/openerp/server/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/server/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, _params)
File "/opt/openerp/server/openerp/osv/osv.py", line 188, in execute_kw
return self.execute(db, uid, obj, method, *args, *_kw or {})
File "/opt/openerp/server/openerp/osv/osv.py", line 131, in wrapper
return f(self, dbname, _args, *_kwargs)
File "/opt/openerp/server/openerp/osv/osv.py", line 197, in execute
res = self.execute_cr(cr, uid, obj, method, _args, *_kw)
File "/opt/openerp/server/openerp/osv/osv.py", line 185, in execute_cr
return getattr(object, method)(cr, uid, _args, *_kw)
File "/opt/openerp/server/openerp/osv/orm.py", line 3623, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/opt/openerp/server/openerp/osv/orm.py", line 3744, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/opt/openerp/server/openerp/osv/fields.py", line 1142, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/opt/openerp/server/openerp/osv/fields.py", line 1208, in _fnct_read
value = value[field] or False
File "/opt/openerp/server/openerp/osv/orm.py", line 405, in getitem
field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
File "/opt/openerp/server/openerp/osv/orm.py", line 3623, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/opt/openerp/server/openerp/osv/orm.py", line 3744, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/opt/openerp/server/openerp/osv/fields.py", line 1142, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/opt/openerp/server/openerp/addons/base/res/res_partner.py", line 212, in
_commercial_partner_id = lambda self, _args, *_kwargs: self._commercial_partner_compute(_args, *_kwargs)
File "/opt/openerp/server/openerp/addons/base/res/res_partner.py", line 206, in _commercial_partner_compute
while not current_partner.is_company and current_partner.parent_id:
File "/opt/openerp/server/openerp/osv/orm.py", line 499, in getattr
raise AttributeError(e)
AttributeError: 'Field is_company not found in browse_record(res.partner, 937)'

[8.0] Fix install of partner_firstname

In the 8.0 branch, the following error occurs when installing partner_first name

ERROR openerp_test openerp.sql_db: bad query: ALTER TABLE "res_partner" ALTER COLUMN "lastname" SET NOT NULL

Traceback (most recent call last):
File "openerp/sql_db.py", line 230, in execute
res = self._obj.execute(query, params)
IntegrityError: column "lastname" contains null values

This could probably be fixed by defaulting lastname to something, or revisiting which fields should be required.

[8.0] partner_relations: group_partner_manager can not add relations from smartbutton

group_partner_manager can not add relations from smartbutton

Impacted versions:

  • 8.0: partner_relations

Steps to reproduce:

  1. Login as a normal user with group_partner_manager access right assigned
  2. Go to a partner form
  3. Click on Relations smartbutton

Current behavior:

  • This view do not show 'Create' button

Expected behavior:

  • Show 'Create' button, because this user can create partner relations
  • Same behavior that in Sales > Sales > Relations view

partner_address_street3

In the module partner_address_street3:

In model/partner.py, there is:

    def _commercial_fields(self, cr, uid, context=None):
        fields = super(res_partner, self
                       )._commercial_fields(cr, uid, context=context)
        fields.append('street3')
        return fields

Street3 is not a commercial field, so this code should not exists.

BUT street3 is an address field, that needs to be synced when you activate "Use parent address" ; for that, the following code is required:

    def _address_fields(self, cr, uid, context=None):
        '''Add street3 in sync of address when you say "Use company address"'''
        res = super(res_partner, self)._address_fields(
            cr, uid, context=context)
        res.append('street3')
        return res

I'll do a PR to fix this when I have time.

[8.0] Runbot lacking OCA_RUNBOT env variable?

This runbot fails because of a warning being raised by this line, but it should not if there is a OCA_RUNBOT variable. It seems like it is not present in runbot anymore.

The failing logs:

2016-01-07 08:03:15     WARNING     server  openerp.addons.base_contact.deprecated:32 <module> This module is DEPRECATED. See /srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3139313-216-4b01e5/openerp/addons/base_contact/README.rst. 

partner_firstname incompatible with contact position

installing the module disable the creation of new contact positions. It gives an integrity error on saving contact changes.
// error message from web interface
Integrity Error

The operation cannot be completed, probably due to the following:

  • deletion: you may be trying to delete a record while other records still reference it
  • creation/update: a mandatory field is not correctly set

[object with reference: lastname - lastname]

//

--- from the log file ----

2015-06-17 15:30:24,569 5462 ERROR xxxx openerp.sql_db: bad query: INSERT INTO "res_partner" ("id", "sale_warn", "purchase_warn", "notify_email", "color", "country_id", "image", "contact_id", "use_parent_address", "active", "street", "city", "tz", "opt_out", "zip", "invoice_warn", "company_id", "parent_id", "picking_warn", "supplier", "type", "email", "is_company", "function", "lang", "vat_subjected", "street2", "customer", "name", "phone", "mobile", "contact_type", "employee", "state_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('res_partner_id_seq'), 'no-message', 'no-message', 'always', 0, NULL, NULL, 12, false, true, 'Rechnung', NULL, 'Europe/Zurich', false, NULL, 'no-message', 1, 7381, 'no-message', false, 'invoice', NULL, false, NULL, 'de_DE', false, 'Adresse', true, 'Company 1 Rechnungs', NULL, NULL, 'standalone', false, NULL, 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
Traceback (most recent call last):
File "/opt/odoo80/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
IntegrityError: null value in column "lastname" violates not-null constraint
DETAIL: Failing row contains (9219, Company 1 Rechnungs, 1, null, null, 2015-06-17 15:30:24.547528, 0, null, null, null, Rechnung, null, null, null, null, null, null, 7381, f, null, null, f, null, t, null, Adresse, f, null, 2015-06-17 15:30:24.547528, t, Europe/Zurich, 1, de_DE, 1, null, null, null, invoice, f, null, null, null, null, null, always, null, f, null, null, null, null, null, null, null, f, null, 12, null, standalone, no-message, no-message, no-message, null, null, null, no-message, null, null, null, null, null, null, null).

2015-06-17 15:30:24,570 5462 ERROR xxxxxx openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
File "/opt/odoo80/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo80/openerp/http.py", line 567, in dispatch
result = self._call_function(*_self.params)
File "/opt/odoo80/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, *kwargs)
File "/opt/odoo80/openerp/service/model.py", line 149, in wrapper
raise openerp.osv.orm.except_orm(
('Integrity Error'), msg)
except_orm: ('Integrity Error', 'The operation cannot be completed, probably due to the following:\n- deletion: you may be trying to delete a record while other records still reference it\n- creation/update: a mandatory field is not correctly set\n\n[object with reference: lastname - lastname]')

2015-06-17 15:30:24,570 5462 INFO sensortec werkzeug: 192.168.2.112 - - [17/Jun/2015 15:30:24] "POST /web/dataset/call_kw/res.partner/write HTTP/1.1" 200 -

Hope this will help

Regards

[8.0] partner_firstname and "create and edit" in M2O widget to res.partner

Here are the steps to reproduce the bug on odoo v8 with an up-to-date branch of OCA/partner-contact/8.0:

  1. Create a new sale order
    In the "Customer" field (M2O to res.partner), type "TOTOTEST1" (it should not be an existing partner) and then, in the down-drop list that appear, click on "Create and Edit..."
  2. You get a pop-up that displays the form view of res.partner with:
    Name = TOTOTEST1
    Firstname = False
    Lastname = False
  3. in the partner pop-up, enter:
    Lastname = de Lattre
    Fistname = Alexis
    Street = 42 rue de la paix
    and click on "Save" in the partner pop-up and save in the quotation form.
  4. Go to the "Customers" menu. You will find a partner with:
    Name = TOTOTEST1
    Lastname = TOTOTEST1
    Firstname = False
    Street = 42 rue de la paix

Conclusion : when the module partner_firstname is installed, we have a bug with "Create and Edit..." in the M2O widget that point to res.partner.

README.md file is inaccurate

The Readme file talks about "knowledge and document management" That looks like a whole other set of modules.
Looks like a copy and paste error. I could be wrong.
I was hoping the README would tell me what was in these modules in case it might solve my current dilema.

`partner_firstname` is Incompatible with `auth_oauth_signup`

Description

When a new user signs in with a configured oauth client on a server which has partner_firstname installed, Odoo will copy the TemplateUser with default values (name, login, email, etc).

Due to the way partner_firstname deals with name to firstname and lastname, it will simply copy the TemplateUser's name are result with a new user with the name "Template User (copy)".

The line which does this is here: https://github.com/OCA/partner-contact/blob/7.0/partner_firstname/res_user.py#L33

This problem could and should be resolved by making an autoinstall module called auth_oauth_signup_partner_firstname which alters the call to signup() to also have firstname and lastname.

This could be really easy to implement with a small change to Odoo's code. The auth_oauth_signup module only adds a single function. This function could be factorized so that the default values creation could be inherited to add the two keys we need without the need to completely overwrite the only function in the entire module.

All that is needed is to factor out the generation of values (https://github.com/odoo/odoo/blob/7.0/addons/auth_oauth_signup/res_users.py#L47) from the validation field into a function such as _generate_signup_values().

Without this change directly to the auth_oauth_signup module, every module changing res_users or with a custom oauth implementation will need to essentially rewrite auth_oauth_signup. What I propose is to factor out the code which desirable to change.

With factorization

from openerp.osv import orm


class res_users(orm.Model):
    _inherit = 'res.users'

    def _generate_signup_values(
            self, cr, uid, provider, validation, params, context=None):
        values = super(res_users, self)._generate_signup_values(
            cr, uid, provider, validation, params, context=context
        )
        values.update(
            lastname=validation.get('lastname') or values.get('name') or False,
            firstname=validation.get('firstname') or False,
        )
        return values

The PR to Odoo related to this: odoo/odoo#2355

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.