Skip to content

Commit

Permalink
[FIX] fix some multi-company issues
Browse files Browse the repository at this point in the history
* ensure creating a cooperator for a non-current company works.
* ensure per-company sequences are used.
* add unique per-company constraint on the cooperator register number.
  • Loading branch information
huguesdk committed Oct 9, 2023
1 parent 4f1157b commit 52dfac1
Show file tree
Hide file tree
Showing 19 changed files with 195 additions and 385 deletions.
2 changes: 1 addition & 1 deletion cooperator/demo/coop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
<field name="country_id" ref="base.be" />
</record>

<record id="cooperator_membership_2_demo" model="cooperative.membership">
<record id="cooperative_membership_2_demo" model="cooperative.membership">
<field name="company_id" ref="base.main_company" />
<field name="partner_id" ref="res_partner_cooperator_2_demo" />
<field name="cooperator" eval="True" />
Expand Down
54 changes: 12 additions & 42 deletions cooperator/i18n/ca_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "%s is not available to companies"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "%s is not available to individuals"
msgstr ""
Expand Down Expand Up @@ -350,14 +348,23 @@ msgstr ""
msgid "<strong>Your Contact:</strong>"
msgstr ""

#. module: cooperator
#: model:ir.model.constraint,message:cooperator.constraint_cooperative_membership_company_id_cooperator_register_numbe_key
msgid "A cooperator register number must be unique (per company)"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/wizard/partner_create_subscription.py:0
#: code:addons/src/oca/cooperative/cooperator/wizard/partner_create_subscription.py:0
#, python-format
msgid "A person can't be representative of two different companies."
msgstr ""

#. module: cooperator
#: model:ir.model.constraint,message:cooperator.constraint_subscription_register_company_id_register_number_operation_key
msgid "A register operation number must be unique (per company)"
msgstr ""

#. module: cooperator
#: model:ir.model,name:cooperator.model_account_chart_template
msgid "Account Chart Template"
Expand Down Expand Up @@ -553,7 +560,6 @@ msgstr "Canceŀlat"
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/res_partner.py:0
#: code:addons/src/oca/cooperative/cooperator/models/res_partner.py:0
#, python-format
msgid "Cannot set {name} field on {record}: {delegate} is not set"
msgstr ""
Expand Down Expand Up @@ -760,7 +766,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "Converting just part of the shares is not yet implemented"
msgstr ""
Expand Down Expand Up @@ -865,15 +870,13 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/res_company.py:0
#: code:addons/src/oca/cooperative/cooperator/models/res_company.py:0
#, python-format
msgid "Cooperator number sequence"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/res_company.py:0
#: code:addons/src/oca/cooperative/cooperator/models/res_company.py:0
#, python-format
msgid "Cooperator register operation sequence"
msgstr ""
Expand Down Expand Up @@ -1086,7 +1089,6 @@ msgstr "Plantilles de correu electrònic"
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "Email and Company Email must be different."
msgstr ""
Expand All @@ -1099,7 +1101,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/wizard/update_share_line.py:0
#: code:addons/src/oca/cooperative/cooperator/wizard/update_share_line.py:0
#, python-format
msgid "Error the update return more than one subscription register lines."
msgstr ""
Expand All @@ -1112,7 +1113,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#: model:ir.model.fields.selection,name:cooperator.selection__subscription_request__gender__female
#, python-format
msgid "Female"
Expand Down Expand Up @@ -1458,7 +1458,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#: model:ir.model.fields.selection,name:cooperator.selection__subscription_request__gender__male
#, python-format
msgid "Male"
Expand Down Expand Up @@ -1593,7 +1592,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "Number of share must be greater than 0."
msgstr ""
Expand All @@ -1618,31 +1616,28 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "Only blocked requests can be unblocked."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "Only draft request can be put on the waiting list."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "Only draft requests can be blocked."
msgstr ""

#. module: cooperator
#: model:ir.model.constraint,message:cooperator.constraint_cooperative_membership_cooperative_membership_company_id_partner_id_key
#: model:ir.model.constraint,message:cooperator.constraint_cooperative_membership_company_id_partner_id_key
msgid ""
"Only one cooperative membership record can exist per company per partner"
"Only one cooperative membership record can exist per partner (per company)"
msgstr ""

#. module: cooperator
Expand Down Expand Up @@ -1683,7 +1678,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#: model:ir.model.fields.selection,name:cooperator.selection__subscription_request__gender__other
#, python-format
msgid "Other"
Expand Down Expand Up @@ -1719,7 +1713,6 @@ msgstr "Telèfon"
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid ""
"Please define income account for this product: \"{name}\" (id: {id}) - or "
Expand Down Expand Up @@ -1859,7 +1852,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "SUBJ"
msgstr ""
Expand Down Expand Up @@ -2172,7 +2164,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#: model:ir.model.fields,field_description:cooperator.field_res_company__subscription_journal_id
#, python-format
msgid "Subscription Journal"
Expand Down Expand Up @@ -2275,23 +2266,20 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "The checkbox already cooperator is checked please select a cooperator."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "The cooperator can't hand over more shares that he/she owns."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid ""
"The cooperator doesn't own this share type. Please choose the appropriate "
Expand All @@ -2301,15 +2289,13 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "The effective date can not be in the future."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid ""
"The information of the receiver are not correct. Please correct the "
Expand All @@ -2319,23 +2305,20 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "The is_operation field of the subscription request must be true"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "The request must be in draft or on waiting list to be validated"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "The source field of the subscription request must be set to operation"
msgstr ""
Expand All @@ -2344,8 +2327,6 @@ msgstr ""
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/cooperator/wizard/partner_create_subscription.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/wizard/partner_create_subscription.py:0
#, python-format
msgid ""
"There is two different persons with the same national register number. "
Expand All @@ -2362,7 +2343,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid ""
"This contact person is already defined for another company. Please select "
Expand All @@ -2372,7 +2352,6 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid ""
"This operation can't be executed if the cooperator is not an effective member"
Expand All @@ -2381,39 +2360,34 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "This operation is not yet implemented."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "This operation must be approved before to be executed"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "This share can not be subscribed an individual"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "This share can not be subscribed by a company"
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "This share type could not be transfered to "
msgstr ""
Expand Down Expand Up @@ -2600,31 +2574,27 @@ msgstr ""
#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "You can't convert the share to the same share type."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "You cannot cancel a request in this state."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/operation_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/operation_request.py:0
#, python-format
msgid "You must convert all the shares to the selected type."
msgstr ""

#. module: cooperator
#. odoo-python
#: code:addons/cooperator/models/subscription_request.py:0
#: code:addons/src/oca/cooperative/cooperator/models/subscription_request.py:0
#, python-format
msgid "You must set a cooperator account on your company."
msgstr ""
Expand Down
Loading

0 comments on commit 52dfac1

Please sign in to comment.