OCA / cooperative

GNU Affero General Public License v3.0
11 stars 22 forks source link

[16.0][MIG] cooperator: migration to 16.0 #86

Closed huguesdk closed 12 months ago

huguesdk commented 1 year ago

/ocabot migration cooperator

OCA-git-bot commented 1 year ago

There's no issue in this repo with the title 'Migration to version 16.0' and the milestone 16.0, so not possible to add the comment.

huguesdk commented 1 year ago

/ocabot migration cooperator

polchampion commented 1 year ago

Functional test 1 - tested 1/09/2023 on 16-test-cooperator

@huguesdk

Setup

RPC_ERROR Odoo Server Error Traceback (most recent call last): File "/home/odoo16/src/odoo/odoo/http.py", line 1583, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "/home/odoo16/src/odoo/odoo/service/model.py", line 134, in retrying result = func() File "/home/odoo16/src/odoo/odoo/http.py", line 1610, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/home/odoo16/src/odoo/odoo/http.py", line 1807, in dispatch result = self.request.registry['ir.http']._dispatch(endpoint) File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch result = endpoint(request.params) File "/home/odoo16/src/odoo/odoo/http.py", line 696, in route_wrapper result = endpoint(self, *args, *params_ok) File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 42, in call_kw return self._call_kw(model, method, args, kwargs) File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/home/odoo16/src/odoo/odoo/api.py", line 457, in call_kw result = _call_kw_model(method, model, args, kwargs) File "/home/odoo16/src/odoo/odoo/api.py", line 430, in _call_kw_model result = method(recs, args, kwargs) File "/home/odoo16/src/odoo/odoo/models.py", line 1605, in name_search ids = self._name_search(name, args, operator, limit=limit) File "/home/odoo16/src/odoo/addons/account/models/account_account.py", line 583, in _name_search return self._search(expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid) File "/home/odoo16/src/odoo/odoo/models.py", line 4629, in _search query = self._where_calc(domain) File "/home/odoo16/src/odoo/odoo/models.py", line 4397, in _where_calc return expression.expression(domain, self).query File "/home/odoo16/src/odoo/odoo/osv/expression.py", line 447, in init self.parse() File "/home/odoo16/src/odoo/odoo/osv/expression.py", line 672, in parse raise ValueError("Invalid field %s.%s in leaf %s" % (model._name, path[0], str(leaf))) ValueError: Invalid field account.account.internal_type in leaf ('internal_type', '=', 'receivable')

The above server error caused the following client error: RPC_ERROR: Odoo Server Error RPCError@https://odoo16.main.test.srv.coopiteasy.be/web/assets/144-d6d42d7/web.assets_backend.min.js:966:274 makeErrorFromResponse@https://odoo16.main.test.srv.coopiteasy.be/web/assets/144-d6d42d7/web.assets_backend.min.js:970:163 jsonrpc/promise</<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/144-d6d42d7/web.assets_backend.min.js:978:34

Yet to test:

Basic flow

Features:

Configurations:

huguesdk commented 1 year ago

@polchampion thanks for the functional testing. good catch! fixed and updated on the test server.

polchampion commented 1 year ago

Functional test 2 - tested 1/09/2023 and 8/09/2023 on 16-test-cooperator @huguesdk a few errors detected below, pausing testing for now

Setup

Basic flow

Features:

error : cannot execute transfer because of email rendering failure (see transfer here)

Erreur utilisateur

Échec de rendu du modèle QWeb :<div style="margin: 0px; padding: 0px;">
    <p style="margin: 0px; padding: 0px; font-size: 13px;">
        Bonjour
        <t t-out="object.subscription_request_ids[0].firstname"></t>,
        <br><br>
        Nous vous confirmons que des parts vous ont été transférées. Si vous n'étiez pas encore coopérateur, bienvenue !
        <br><br>
        Vous trouverez votre certificat de coopérateur de <t t-out="object.env.company.name"></t> en pièce jointe.
        <br><br>
        Coopérativement,
    </p>
</div>
        )

error : operation.request form keeps raising errors because of past information steps to reproduce:

  1. create operation request
  2. select share transfer
  3. select a cooperator
  4. select a share type that doesn't belong to the chosen cooperator, try to validate --> error (that's normal)
  5. change the share type, try to validate --> now still the same error

strange behaviour (share transfer): it's possible to add more than one transfer-to partner lines, which very logically gives an error

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/models.py", line 5152, in ensure_one
    _id, = self._ids
ValueError: too many values to unpack (expected 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo16/src/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo16/src/odoo/odoo/http.py", line 1815, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo16/src/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 46, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo16/src/oca/cooperative/cooperator/models/operation_request.py", line 139, in submit_operation
    rec.validate()
  File "/home/odoo16/src/oca/cooperative/cooperator/models/operation_request.py", line 269, in validate
    and not self.subscription_request.is_valid_iban
  File "/home/odoo16/src/odoo/odoo/fields.py", line 1153, in __get__
    record.ensure_one()
  File "/home/odoo16/src/odoo/odoo/models.py", line 5155, in ensure_one
    raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: subscription.request(30, 29)

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPCError@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets_backend.min.js:981:274
    makeErrorFromResponse@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets_backend.min.js:985:163
    jsonrpc/promise</<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets_backend.min.js:993:34

missing feature (share transfer): no bin icon to delete transfer-to partner lines screenshot-odoo16 main test srv coopiteasy be-2023 09 08-16_14_22

Added features during test

error on this partner, though worked on another

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo16/src/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo16/src/odoo/odoo/http.py", line 1815, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo16/src/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo16/src/odoo/odoo/models.py", line 6401, in onchange
    defaults = self.default_get(missing_names)
  File "/home/odoo16/src/odoo/odoo/models.py", line 1392, in default_get
    defaults[name] = field.default(self)
  File "/home/odoo16/src/oca/cooperative/cooperator/wizard/partner_create_subscription.py", line 33, in _default_product_id
    return self.env["product.product"].search(domain)[0]
  File "/home/odoo16/src/odoo/odoo/models.py", line 5895, in __getitem__
    return self.browse((self._ids[key],))
IndexError: tuple index out of range

The above server error caused the following client error:
null

Configurations:

polchampion commented 1 year ago

@huguesdk Not a big deal but I found this error when trying to save this subscription request so that odoo underline the compulsory fields :


Échec de rendu du modèle inline_template :<class 'TypeError'>: "can only concatenate str (not "bool") to str" while evaluating
' object.is_company and (", " + object.company_email) ')

screenshot-odoo16 main test srv coopiteasy be-2023 09 08-15_15_44

event: Object { type: undefined, timeStamp: 1694178550743, jQuery331027005866348175034: true, … }
legacy: true
message: RPC\_ERROR: Odoo Server Error
code: 200
columnNumber: 274
data: Object { name: "odoo.exceptions.UserError", debug: \`Traceback (most recent call last):\\n File "/home/odoo16/src/odoo/odoo/tools/safe\_eval.py", line 362, in safe\_eval\\n return unsafe\_eval(c, globals\_dict, locals\_dict)\\n File "", line 1, in <module>\\nTypeError: can only concatenate str (not "bool") to str\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n File "/home/odoo16/src/odoo/addons/mail/models/mail\_render\_mixin.py", line 418, in \_render\_template\_inline\_template\\n results\[record.id\] = render\_inline\_template(template\_instructions, variables)\\n File "/home/odoo16/src/odoo/odoo/tools/rendering\_tools.py", line 71, in render\_inline\_template\\n result = safe\_eval.safe\_eval(expression, variables)\\n File "/home/odoo16/src/odoo/odoo/tools/safe\_eval.py", line 376, in safe\_eval\\n raise ValueError('%s: "%s" while evaluating\\\\n%r' % (ustr(type(e)), ustr(e), expr))\\nValueError: <class 'TypeError'>: "can only concatenate str (not "bool") to str" while evaluating\\n' object.is\_company and (", " + object.company\_email) '\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n File "/home/odoo16/src/odoo/odoo/http.py", line 1584, in \_serve\_db\\n return service\_model.retrying(self.\_serve\_ir\_http, self.env)\\n File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying\\n result = func()\\n File "/home/odoo16/src/odoo/odoo/http.py", line 1611, in \_serve\_ir\_http\\n response = self.dispatcher.dispatch(rule.endpoint, args)\\n File "/home/odoo16/src/odoo/odoo/http.py", line 1815, in dispatch\\n result = self.request.registry\['ir.http'\].\_dispatch(endpoint)\\n File "/home/odoo16/src/odoo/odoo/addons/base/models/ir\_http.py", line 154, in \_dispatch\\n result = endpoint(\*\*request.params)\\n File "/home/odoo16/src/odoo/odoo/http.py", line 697, in route\_wrapper\\n result = endpoint(self, \*args, \*\*params\_ok)\\n File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 42, in call\_kw\\n return self.\_call\_kw(model, method, args, kwargs)\\n File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in \_call\_kw\\n return call\_kw(request.env\[model\], method, args, kwargs)\\n File "/home/odoo16/src/odoo/odoo/api.py", line 459, in call\_kw\\n result = \_call\_kw\_model\_create(method, model, args, kwargs)\\n File "/home/odoo16/src/odoo/odoo/api.py", line 439, in \_call\_kw\_model\_create\\n result = method(recs, \*args, \*\*kwargs)\\n File "<decorator-gen-345>", line 2, in create\\n File "/home/odoo16/src/odoo/odoo/api.py", line 409, in \_model\_create\_multi\\n return create(self, \[arg\])\\n File "/home/odoo16/src/oca/cooperative/cooperator/models/subscription\_request.py", line 140, in create\\n subscription\_request.\_send\_confirmation\_mail()\\n File "/home/odoo16/src/oca/cooperative/cooperator/models/subscription\_request.py", line 76, in \_send\_confirmation\_mail\\n mail\_template\_notif.sudo().send\_mail(\\n File "/home/odoo16/src/odoo/addons/mail/models/mail\_template.py", line 335, in send\_mail\\n values = self.generate\_email(\\n File "/home/odoo16/src/odoo/addons/account\_edi/models/mail\_template.py", line 39, in generate\_email\\n res = super().generate\_email(res\_ids, fields)\\n File "/home/odoo16/src/odoo/addons/mail/models/mail\_template.py", line 248, in generate\_email\\n generated\_field\_values = template.\_render\_field(\\n File "/home/odoo16/src/odoo/addons/mail/models/mail\_render\_mixin.py", line 569, in \_render\_field\\n return dict(\\n File "/home/odoo16/src/odoo/addons/mail/models/mail\_render\_mixin.py", line 572, in <genexpr>\\n for res\_id, rendered in template.\_render\_template(\\n File "/home/odoo16/src/odoo/addons/mail/models/mail\_render\_mixin.py", line 474, in \_render\_template\\n rendered = self.\_render\_template\_inline\_template(template\_src, model, res\_ids,\\n File "/home/odoo16/src/odoo/addons/mail/models/mail\_render\_mixin.py", line 421, in \_render\_template\_inline\_template\\n raise UserError(\_("Failed to render inline\_template template : %s)", e))\\nodoo.exceptions.UserError: Échec de rendu du modèle inline\_template :<class 'TypeError'>: "can only concatenate str (not "bool") to str" while evaluating\\n' object.is\_company and (", " + object.company\_email) ')\\n\`, message: \`Échec de rendu du modèle inline\_template :<class 'TypeError'>: "can only concatenate str (not "bool") to str" while evaluating\\n' object.is\_company and (", " + object.company\_email) ')\`, … }

​​

exceptionName: "odoo.exceptions.UserError"
fileName: "[https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js](https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets_backend.min.js "https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets_backend.min.js")"
lineNumber: 981
message: "Odoo Server Error"
name: "RPC\_ERROR"
stack: "RPCError@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:981:274\\nmakeErrorFromResponse@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:985:163\\njsonrpc/promise</<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:993:34\\nEventListener.handleEvent\*jsonrpc/promise<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:987:9\\njsonrpc@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:986:259\\nrpc@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:997:127\\nmapLegacyEnvToWowlEnv/legacyEnv.session.rpc/prom<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:6828:32\\nmapLegacyEnvToWowlEnv/legacyEnv.session.rpc@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:6827:211\\n\_trigger\_up/prom<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:2427:69\\n\_trigger\_up@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:2427:12\\n\_trigger\_up@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5915:462\\ntrigger\_up@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5915:280\\ncall@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5968:372\\n\_rpc@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5968:567\\n\_rpc@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:7905:13\\nOdooClass.extend/</prototype\[name\]<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5770:488\\n\_rpc@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:8225:183\\nOdooClass.extend/</prototype\[name\]<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5770:488\\nsave/\_save/prom<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:8029:96\\n\_save@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:8027:10\\nexec/this.lock</<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5780:607\\npromise callback\*exec/this.lock<@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5780:584\\nexec@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:5780:536\\nsave@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:8033:61\\nsave@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:2354:103\\nasync\*saveButtonClicked@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:3933:203\\nsave@https://odoo16.main.test.srv.coopiteasy.be/web/assets/163-43add22/web.assets\_backend.min.js:3991:31\\nmainEventHandler@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:2106:77\\nlistener@https://odoo16.main.test.srv.coopiteasy.be/web/assets/162-c10639e/web.assets\_common.min.js:1282:15\\n"
subType: undefined
type: "server"
polchampion commented 1 year ago

@huguesdk a few errors (of which one is really problematic) reported above see here

huguesdk commented 1 year ago

@polchampion the problematic error should now be fixed. you will need to re-install the module on a new database to test this because it is caused by data in mail templates and the are set to noupdate.

huguesdk commented 1 year ago

@polchampion the error related to required company fields should now be fixed too. good catch!

huguesdk commented 1 year ago

before merging this, since it is a major version anyway, i think it would the right time to perform some needed renaming. here’s some suggestions:

models

before deciding on this, we should search for official cooperative terms in english.

fields

most fields that have been added to existing models use a too generic name. they should be more specific to make their meaning more obvious and avoid possible name clashes. if they are truly generic, they should be moved to a separate module. here are some examples:

any thoughts on this, @robinkeunen?

robinkeunen commented 1 year ago

I like renaming stuff

models

  • subscription.request: cooperative.subscription.request (or cooperative.membership.request?

I prefer cooperative.subscription.request which is closer to the domain we're using. I'm a bit scared though of the length of the name. I'm afraid it might be a pain to use. Would the coop prefix be enough ?

  • subscription.register: cooperative.register.operation (or cooperative.register.entry or cooperative.register.line or cooperative.operation or cooperative.operation.register or cooperative.share.register or simply cooperative.register (since “register” means the book as well as it entries)?)

I think your first proposition is the best : cooperative.register.operation

  • operation.request: cooperative.operation.request

I'm convinced we could make cooperative.subscription.request more generic in the future and merge it in cooperative.operation.request.

  • share.line: cooperative.shareholding (or cooperative.shareholding.line)

Why not cooperative.share dict ?

fields

  • res.company.default_lang_id
  • res.company.logo_url
  • res.partner.member
  • res.partner.total_value
  • product.template.short_name
  • product.template.display_on_website

any thoughts on this, @robinkeunen?

I agree with you that these fields are poorly named. Out of context, I can't tell that they are linked to cooperator. res.partner.member is especially confusing since the membership module has similar names.

hitrosol commented 1 year ago

Hi, I'm curious to know the functionality of this module.

When the subscription request is validated, the system creates Customer Invoice (account.move) by credit the Product Sales and Debit the Cooperators account. I guess the Product Sales should be an Equity because by subscribing to the Cooperative, the new member will become one of the owners of the Cooperative.

But, since someone can create subscription request and never pay the Invoice, it means the membership and the ownership will be valid if the invoice is finally paid. This creates the inconsistency information between the Journal Items and the subscription register. The balance sheet report will take information from journal items where the amount is not tally with the subscription register. As default odoo will treat the income on accrual basis, but for this specific use case we need to consider using the cash basis approach to acknowledge the increasing of the equity in the financial reporting. In our case we thinking adding the reserved field in the product template and the additional journal entries will be created whenever invoice is paid.

Regarding the Operation Types, IMO any Transfer, Sell Back and Conversion activity need to have the journal entries related as well, to keep the subscription request is tally with the journal items.

Thanks,

huguesdk commented 1 year ago

i’ve just converted this to draft since we’re still working on many improvements before releasing cooperator 16.0.1.0.0.

polchampion commented 1 year ago

Functional test 3 - tested 20/11/2023 on 16-test-cooperator @huguesdk two new issues to look at, plus the "create subscription" functionality on partner still not working

Setup

Basic flow

Features:

error : can't validate multicompany share request I added a company ("deuxième structure"), an cooperative accounting account on company two, a subscription journal (though shouldn't it be created automatically for company two?), a share product for company two. I then tried to validate this draft subscription request.

The operation cannot be completed:

  • Create/update: a mandatory field is not set.
  • Delete: another model requires the record being deleted. If possible, archive it instead.

Model: Journal Entry (account.move) Field: Journal (journal_id)

screenshot-odoo16 main test srv coopiteasy be-2023 11 20-16_48_46

Added features during test

error on this partner, though worked on another

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo16/src/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo16/src/odoo/odoo/http.py", line 1815, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo16/src/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo16/src/odoo/odoo/models.py", line 6401, in onchange
    defaults = self.default_get(missing_names)
  File "/home/odoo16/src/odoo/odoo/models.py", line 1392, in default_get
    defaults[name] = field.default(self)
  File "/home/odoo16/src/oca/cooperative/cooperator/wizard/partner_create_subscription.py", line 33, in _default_product_id
    return self.env["product.product"].search(domain)[0]
  File "/home/odoo16/src/odoo/odoo/models.py", line 5895, in __getitem__
    return self.browse((self._ids[key],))
IndexError: tuple index out of range

The above server error caused the following client error:
null

Configurations:

huguesdk commented 1 year ago

@polchampion: my answers below:

  • [ ] Can be used with multi-company configuration --> NOK

error : can't validate multicompany share request I added a company ("deuxième structure"), an cooperative accounting account on company two, a subscription journal (though shouldn't it be created automatically for company two?), a share product for company two. I then tried to validate this draft subscription request.

The operation cannot be completed:

  • Create/update: a mandatory field is not set.
  • Delete: another model requires the record being deleted. If possible, archive it instead.

Model: Journal Entry (account.move) Field: Journal (journal_id)

this is because the company has no subscription journal. it is created automatically when a chart of account is configured on the company (settings > invoicing > fiscale localization > package).

  • [ ] Generate Cooperator Certificate and several reports about cooperators --> button missing to print cooperators register error : no way to print cooperators register - button missing in 'print' menu

screenshot-odoo16 main test srv coopiteasy be-2023 11 20-16_48_46

this has moved: it is now available from the cooperator register (registers > cooperator register).

  • [ ] Click "create subscription request" button on partner --> Still NOK, same error as below

error on this partner, though worked on another

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo16/src/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo16/src/odoo/odoo/http.py", line 1815, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo16/src/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo16/src/odoo/odoo/models.py", line 6401, in onchange
    defaults = self.default_get(missing_names)
  File "/home/odoo16/src/odoo/odoo/models.py", line 1392, in default_get
    defaults[name] = field.default(self)
  File "/home/odoo16/src/oca/cooperative/cooperator/wizard/partner_create_subscription.py", line 33, in _default_product_id
    return self.env["product.product"].search(domain)[0]
  File "/home/odoo16/src/odoo/odoo/models.py", line 5895, in __getitem__
    return self.browse((self._ids[key],))
IndexError: tuple index out of range

The above server error caused the following client error:
null

this is because there are no configured share products available for companies. i added an error message in this case.

huguesdk commented 1 year ago

@polchampion: my answers below:

  • [ ] Can be used with multi-company configuration --> NOK

error : can't validate multicompany share request I added a company ("deuxième structure"), an cooperative accounting account on company two, a subscription journal (though shouldn't it be created automatically for company two?), a share product for company two. I then tried to validate this draft subscription request.

The operation cannot be completed:

  • Create/update: a mandatory field is not set.
  • Delete: another model requires the record being deleted. If possible, archive it instead.

Model: Journal Entry (account.move) Field: Journal (journal_id)

this is because the company has no subscription journal. it is created automatically when a chart of account is configured on the company (settings > invoicing > fiscal localization > package).

  • [ ] Generate Cooperator Certificate and several reports about cooperators --> button missing to print cooperators register error : no way to print cooperators register - button missing in 'print' menu

screenshot-odoo16 main test srv coopiteasy be-2023 11 20-16_48_46

this has moved: it is now available from the cooperator register (registers > cooperator register).

  • [ ] Click "create subscription request" button on partner --> Still NOK, same error as below

error on this partner, though worked on another

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo16/src/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo16/src/odoo/odoo/http.py", line 1815, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo16/src/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo16/src/odoo/odoo/models.py", line 6401, in onchange
    defaults = self.default_get(missing_names)
  File "/home/odoo16/src/odoo/odoo/models.py", line 1392, in default_get
    defaults[name] = field.default(self)
  File "/home/odoo16/src/oca/cooperative/cooperator/wizard/partner_create_subscription.py", line 33, in _default_product_id
    return self.env["product.product"].search(domain)[0]
  File "/home/odoo16/src/odoo/odoo/models.py", line 5895, in __getitem__
    return self.browse((self._ids[key],))
IndexError: tuple index out of range

The above server error caused the following client error:
null

this is because there are no configured share products available for this type of partner (a company in this case). there should be at least one product marked as “is share?” and “can be subscribed by companies?”. i added an error message in this case. (coopiteasy#4)

huguesdk commented 1 year ago

i’ve split changes into separate commits for clarity. this branch is almost ready (still waiting for reviews or fixes on coopiteasy#3 and coopiteasy#4). the module version is currently set at version 16.0.0.1.0 instead of 16.0.1.0.0 to indicate that it is still being developed. before merging, the migration folder should be renamed to 16.0.1.0.0 (although it would still work with its current name). this branch should be merged as a major change. this will update the version to 16.0.1.0.0.

polchampion commented 12 months ago

Functional test 4 - tested 27/11/2023 on 16-test-cooperator

Setup

Basic flow

Features:

Added features during test

Configurations:

polchampion commented 12 months ago
  • [ ] Click "create subscription request" button on partner --> Still NOK, same error as below

error on this partner, though worked on another

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo16/src/odoo/odoo/http.py", line 1611, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo16/src/odoo/odoo/http.py", line 1815, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo16/src/odoo/odoo/http.py", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo16/src/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo16/src/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo16/src/odoo/odoo/models.py", line 6401, in onchange
    defaults = self.default_get(missing_names)
  File "/home/odoo16/src/odoo/odoo/models.py", line 1392, in default_get
    defaults[name] = field.default(self)
  File "/home/odoo16/src/oca/cooperative/cooperator/wizard/partner_create_subscription.py", line 33, in _default_product_id
    return self.env["product.product"].search(domain)[0]
  File "/home/odoo16/src/odoo/odoo/models.py", line 5895, in __getitem__
    return self.browse((self._ids[key],))
IndexError: tuple index out of range

The above server error caused the following client error:
null

this is because there are no configured share products available for this type of partner (a company in this case). there should be at least one product marked as “is share?” and “can be subscribed by companies?”. i added an error message in this case. (coopiteasy#4)

@huguesdk There are two share product for My Company available for companies, plus this partner is already cooperator with one of the type of shares.

all other tests are ok !

polchampion commented 12 months ago

@huguesdk and one minor thing : the "subscription register" should be renamed "operation register", although that should be checked and followed with Cath, not here

huguesdk commented 12 months ago

@polchampion

  • [ ] Click "create subscription request" button on partner --> Still NOK, same error as below

this is because there are no configured share products available for this type of partner (a company in this case). there should be at least one product marked as “is share?” and “can be subscribed by companies?”. i added an error message in this case. (coopiteasy#4)

@huguesdk There are two share product for My Company available for companies, plus this partner is already cooperator with one of the type of shares.

sorry, i forgot one condition: the default_share_product field of the share must also be true. with this, it works.

polchampion commented 12 months ago

@polchampion

  • [ ] Click "create subscription request" button on partner --> Still NOK, same error as below

this is because there are no configured share products available for this type of partner (a company in this case). there should be at least one product marked as “is share?” and “can be subscribed by companies?”. i added an error message in this case. (coopiteasy#4)

@huguesdk There are two share product for My Company available for companies, plus this partner is already cooperator with one of the type of shares.

sorry, i forgot one condition: the default_share_product field of the share must also be true. with this, it works.

@huguesdk ok, I updated yesterday's test report, all good. I added two items not in the original description though, it could be included in the module functionality list:

Waiting list: add subscription request to waiting list which triggers an automatic email Click "create subscription request" button on partner

huguesdk commented 12 months ago

/ocabot merge major

OCA-git-bot commented 12 months ago

Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 16.0-ocabot-merge-pr-86-by-huguesdk-bump-major, awaiting test results.

OCA-git-bot commented 12 months ago

Congratulations, your PR was merged at da48e0b97d71a0744ebe539abc3ea442c3945ec8. Thanks a lot for contributing to OCA. ❤️