Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
odoo
Commits
7bfade61
Commit
7bfade61
authored
Jun 06, 2024
by
Odoo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent gone and associated status to be lost where _compute_cooperative_state is called
parent
b00fcdad
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
7 deletions
+13
-7
__openerp__.py
intercoop_addons/coop_membership/__openerp__.py
+1
-1
res_partner.py
intercoop_addons/coop_membership/models/res_partner.py
+6
-3
README.rst
intercoop_addons/coop_shift/README.rst
+2
-0
__openerp__.py
intercoop_addons/coop_shift/__openerp__.py
+1
-1
res_partner.py
intercoop_addons/coop_shift/model/res_partner.py
+2
-1
res_partner.py
lacagette_addons/lacagette_membership/models/res_partner.py
+1
-1
No files found.
intercoop_addons/coop_membership/__openerp__.py
View file @
7bfade61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
{
{
'name'
:
'Coop - Membership'
,
'name'
:
'Coop - Membership'
,
'version'
:
'9.0.2.0.
0
'
,
'version'
:
'9.0.2.0.
1
'
,
'category'
:
'Custom'
,
'category'
:
'Custom'
,
'summary'
:
'Custom settings for membership'
,
'summary'
:
'Custom settings for membership'
,
'author'
:
'La Louve'
,
'author'
:
'La Louve'
,
...
...
intercoop_addons/coop_membership/models/res_partner.py
View file @
7bfade61
...
@@ -16,7 +16,6 @@ from openerp import SUPERUSER_ID
...
@@ -16,7 +16,6 @@ from openerp import SUPERUSER_ID
from
lxml
import
etree
from
lxml
import
etree
from
openerp.osv.orm
import
setup_modifiers
from
openerp.osv.orm
import
setup_modifiers
EXTRA_COOPERATIVE_STATE_SELECTION
=
[
EXTRA_COOPERATIVE_STATE_SELECTION
=
[
(
'not_concerned'
,
'Not Concerned'
),
(
'not_concerned'
,
'Not Concerned'
),
(
'unsubscribed'
,
'Unsubscribed'
),
(
'unsubscribed'
,
'Unsubscribed'
),
...
@@ -28,13 +27,15 @@ EXTRA_COOPERATIVE_STATE_SELECTION = [
...
@@ -28,13 +27,15 @@ EXTRA_COOPERATIVE_STATE_SELECTION = [
(
'delay'
,
'Delay'
),
(
'delay'
,
'Delay'
),
(
'blocked'
,
'Blocked'
),
(
'blocked'
,
'Blocked'
),
(
'unpayed'
,
'Unpayed'
),
(
'unpayed'
,
'Unpayed'
),
(
'gone'
,
'Gone'
),
# Used by LaCagette and followers
(
'associated'
,
'Associated'
)
# Used by LaCagette and followers
]
]
class
ResPartner
(
models
.
Model
):
class
ResPartner
(
models
.
Model
):
_inherit
=
'res.partner'
_inherit
=
'res.partner'
COOPERATIVE_STATE_CUSTOMER
=
[
'up_to_date'
,
'alert'
,
'delay'
,
'exempted'
]
COOPERATIVE_STATE_CUSTOMER
=
[
'up_to_date'
,
'alert'
,
'delay'
,
'exempted'
,
'gone'
,
'associated'
]
SEX_SELECTION
=
[
SEX_SELECTION
=
[
(
'm'
,
'male'
),
(
'm'
,
'male'
),
...
@@ -328,7 +329,9 @@ class ResPartner(models.Model):
...
@@ -328,7 +329,9 @@ class ResPartner(models.Model):
@api.multi
@api.multi
def
_compute_cooperative_state
(
self
):
def
_compute_cooperative_state
(
self
):
for
partner
in
self
:
for
partner
in
self
:
if
partner
.
is_associated_people
:
if
partner
.
working_state
in
[
'gone'
,
'associated'
]:
partner
.
cooperative_state
=
partner
.
working_state
elif
partner
.
is_associated_people
:
# Associated People
# Associated People
partner
.
cooperative_state
=
partner
.
parent_id
.
cooperative_state
partner
.
cooperative_state
=
partner
.
parent_id
.
cooperative_state
elif
partner
.
is_worker_member
:
elif
partner
.
is_worker_member
:
...
...
intercoop_addons/coop_shift/README.rst
View file @
7bfade61
...
@@ -21,6 +21,8 @@ On Partners, it creates a new state 'working_state' with the following value:
...
@@ -21,6 +21,8 @@ On Partners, it creates a new state 'working_state' with the following value:
('suspended', 'Suspended'),
('suspended', 'Suspended'),
('delay', 'Delay'),
('delay', 'Delay'),
('blocked', 'Blocked'),
('blocked', 'Blocked'),
('gone', 'Gone'),
('associated', 'Associated')
Configuration
Configuration
=============
=============
...
...
intercoop_addons/coop_shift/__openerp__.py
View file @
7bfade61
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
{
{
'name'
:
'Coop Shift'
,
'name'
:
'Coop Shift'
,
'version'
:
'9.0.7.0.
0
'
,
'version'
:
'9.0.7.0.
1
'
,
'category'
:
'Tools'
,
'category'
:
'Tools'
,
'author'
:
'Julien WESTE, Sylvain LE GAL, Cyril Gaspard, La Louve'
,
'author'
:
'Julien WESTE, Sylvain LE GAL, Cyril Gaspard, La Louve'
,
'website'
:
'http://www.lalouve.net'
,
'website'
:
'http://www.lalouve.net'
,
...
...
intercoop_addons/coop_shift/model/res_partner.py
View file @
7bfade61
...
@@ -30,7 +30,6 @@ from openerp.exceptions import ValidationError
...
@@ -30,7 +30,6 @@ from openerp.exceptions import ValidationError
from
.date_tools
import
conflict_period
from
.date_tools
import
conflict_period
class
ResPartner
(
models
.
Model
):
class
ResPartner
(
models
.
Model
):
_inherit
=
'res.partner'
_inherit
=
'res.partner'
...
@@ -48,6 +47,8 @@ class ResPartner(models.Model):
...
@@ -48,6 +47,8 @@ class ResPartner(models.Model):
(
'suspended'
,
'Suspended'
),
(
'suspended'
,
'Suspended'
),
(
'delay'
,
'Delay'
),
(
'delay'
,
'Delay'
),
(
'blocked'
,
'Blocked'
),
(
'blocked'
,
'Blocked'
),
(
'gone'
,
'Gone'
),
# Used by La Cagette and followers
(
'associated'
,
'Associated'
)
# Used by La Cagette and followers
]
]
# Columns Section
# Columns Section
...
...
lacagette_addons/lacagette_membership/models/res_partner.py
View file @
7bfade61
...
@@ -172,7 +172,7 @@ class ResPartner(models.Model):
...
@@ -172,7 +172,7 @@ class ResPartner(models.Model):
def
set_special_state
(
self
,
cr
,
uid
,
partner
,
context
=
None
):
def
set_special_state
(
self
,
cr
,
uid
,
partner
,
context
=
None
):
if
partner
[
'state'
]
==
'cancel_special'
:
if
partner
[
'state'
]
==
'cancel_special'
:
partner
[
'state'
]
=
'unsubscribed'
partner
[
'state'
]
=
'unsubscribed'
return
self
.
write
(
cr
,
uid
,
[
partner
[
'id'
]],
{
'cooperative_state'
:
partner
[
'state'
]}
,
context
=
context
)
return
self
.
write
(
cr
,
uid
,
[
partner
[
'id'
]],
{
'cooperative_state'
:
partner
[
'state'
]
,
'working_state'
:
partner
[
'state'
]
}
,
context
=
context
)
def
_write_state_change
(
self
,
state
):
def
_write_state_change
(
self
,
state
):
data
=
{
'member_id'
:
self
.
id
,
'state'
:
state
}
data
=
{
'member_id'
:
self
.
id
,
'state'
:
state
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment