Skip to content

Commit

Permalink
[FIX] partner_state: users perm
Browse files Browse the repository at this point in the history
closes #105

Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
  • Loading branch information
mav-adhoc committed Apr 8, 2024
1 parent 4af8105 commit 076d051
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion partner_state/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Partner State',
'version': "16.0.1.1.0",
'version': "16.0.1.2.0",
'category': 'Base',
'author': 'ADHOC SA, Odoo Community Association (OCA)',
'website': 'www.adhoc.com.ar',
Expand Down
4 changes: 1 addition & 3 deletions partner_state/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ def _track_get_fields(self):
# TODO we should use company of modified partner
for line in self.env['res.partner.state_field'].search([]):
if line.track:
line.changes = True
if line.changes:
tracked_fields.append(line.field_id.name)
if tracked_fields:
return set(self.fields_get(tracked_fields))
Expand All @@ -122,7 +120,7 @@ def _message_track(self, tracked_fields, initial_values):
"""
# TODO we should use company of modified partner
for line in self.env['res.partner.state_field'].search([(
'changes', '=', True)]):
'track', '=', True)]):
field = self._fields[line.field_id.name]
setattr(field, 'track_visibility', 'always')
return super()._message_track(
Expand Down
12 changes: 1 addition & 11 deletions partner_state/models/res_partner_state_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# directory
##############################################################################

from odoo import models, fields, api
from odoo import models, fields


class ResPartnerStateField(models.Model):
Expand All @@ -22,11 +22,6 @@ class ResPartnerStateField(models.Model):
help="Required for Approval",
default=True
)
changes = fields.Boolean(
'Changes?',
help="Track changes of the partner in the chatter box",
default=True
)
track = fields.Boolean(
'Track?',
help="Track and, if change, go back to Potencial",
Expand All @@ -36,8 +31,3 @@ class ResPartnerStateField(models.Model):
help="Do not allow to edit this field if the partner is approved",
default=True,
)

@api.onchange('track')
def _compute_changes(self):
if self.track:
self.changes = True
1 change: 0 additions & 1 deletion partner_state/views/res_partner_state_field_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<tree editable="top">
<field name="field_id" options="{'no_create': True, 'no_open': True}"/>
<field name="approval"/>
<field name="changes"/>
<field name="track"/>
<field name="block_edition"/>
</tree>
Expand Down

0 comments on commit 076d051

Please sign in to comment.