OCA/connector — pull request #32 by JonathanNEMRY (2014-11-19 12:54:26+00:00)
Title: [FIX][connector] switch unlink of producer into the new api to avoid old...

.../new odoo confusion

* Create a Database
* Install "Products & Pricelists" & "Purchase" & "Sales Management"
* Settings/Configuration/Purchases --> Manage different units of measure for products
* Settings/Configuration/Purchases --> Manage pricelist per supplier
* Invoicing/Create customer "customer"
* Édit "customer" and change its "Purchase Pricelist" (create a second one before)
* Install connector module
* Edit the created "customer" and change its "Purchase Pricelist" with the default one (it must be the real default purchase pricelist because it will make an unlink)

* Save and see "TypeError: unlink() takes at least 4 arguments (1 given)"

Into
-----
`@api.model
def set_multi(self, name, model, values):`
of `ir.property`

Behavior without connector:
---------------------------

the `prop.unlink()` is well redirected to
`BaseModel.unlink(cr, uid, ids, context)` passing by the wrapper/new_api

**--> works pretty well**

------------------------
Behavior with connector:
------------------------

the `prop.unlink()` is NOT well redirected:

`producer.unlink(cr, uid, ids, context)` passing by the wrapper/OLD_API

**--> takes at least 4 arguments (1 given)**

Supposion:
----------

I personally do not think this is a `connector` bug because it mostly appears as a
`old/new api` problem (seems that `unlink` is called as new `api` from `ir.property`
but not defined as such into `BaseModel`).

**BUT** it can be resolved by switching the `producer.unlink` into new `api`.

If you have some other solution and/or any ideas

(Note that test will fail: maybe rebase after merging this https://github.com/OCA/connector/pull/31)

-jne