Skip to content

Conversation

jpp-odoo
Copy link
Contributor

@jpp-odoo jpp-odoo commented Mar 6, 2025

  • Open a record (e.g., a project task);
  • Add a tag to a many2many_tags field;
  • Remove the previously added tag;
  • The record should be dirty (the save icon should be visible);
  • Click on the save icon/or click to pager next.

Before this commit, the UI does nothing. It doesn't save, or it doesn't go to
the next record if you click on the pager next. This is because even if the
record is considered dirty, because some changes have been made (adding and
removing tags), there are no changes. And a condition prevents to call the
web_save RPC from being called if there are no changes. If the web_save
RPC is not called, we do nothing.

In this commit, we change this condition so that if the web_save RPC is not
called, we mark the record as not dirty. When we move to another record (pager
next), we do not need to mark the current record as not dirty, but the next
record is loaded.

@robodoo
Copy link
Contributor

robodoo commented Mar 6, 2025

Pull request status dashboard

@C3POdoo C3POdoo requested review from a team, kmagusiak and xmo-odoo and removed request for a team March 6, 2025 13:28
@jpp-odoo jpp-odoo force-pushed the 17.0-save_many2many_tags_dirty_wo_changes-jpp branch from 4bcec16 to 86ff449 Compare March 6, 2025 13:48
@C3POdoo C3POdoo added the RD research & development, internal work label Mar 6, 2025
@jpp-odoo jpp-odoo marked this pull request as draft March 6, 2025 14:29
- Open a record (e.g., a project task);
- Add a tag to a `many2many_tags` field;
- Remove the previously added tag;
- The record should be dirty (the save icon should be visible);
- Click on the save icon/or click to pager next.

Before this commit, the UI does nothing. It doesn't save, or it doesn't go to
the next record if you click on the pager next. This is because even if the
record is considered dirty, because some changes have been made (adding and
removing tags), there are no changes. And a condition prevents to call the
`web_save` RPC from being called if there are no changes. If the `web_save`
RPC is not called, we do nothing.

In this commit, we change this condition so that if the `web_save` RPC is not
called, we mark the record as not dirty. When we move to another record (pager
next), we do not need to mark the current record as not dirty, but the next
record is loaded.
@jpp-odoo jpp-odoo force-pushed the 17.0-save_many2many_tags_dirty_wo_changes-jpp branch from c836afc to ad64e33 Compare March 10, 2025 13:48
@jpp-odoo jpp-odoo marked this pull request as ready for review March 10, 2025 13:48
Copy link
Contributor

@aab-odoo aab-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo r+

robodoo pushed a commit that referenced this pull request Mar 10, 2025
- Open a record (e.g., a project task);
- Add a tag to a `many2many_tags` field;
- Remove the previously added tag;
- The record should be dirty (the save icon should be visible);
- Click on the save icon/or click to pager next.

Before this commit, the UI does nothing. It doesn't save, or it doesn't go to
the next record if you click on the pager next. This is because even if the
record is considered dirty, because some changes have been made (adding and
removing tags), there are no changes. And a condition prevents to call the
`web_save` RPC from being called if there are no changes. If the `web_save`
RPC is not called, we do nothing.

In this commit, we change this condition so that if the `web_save` RPC is not
called, we mark the record as not dirty. When we move to another record (pager
next), we do not need to mark the current record as not dirty, but the next
record is loaded.

closes #200549

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
@robodoo robodoo closed this Mar 10, 2025
@jpp-odoo jpp-odoo deleted the 17.0-save_many2many_tags_dirty_wo_changes-jpp branch March 11, 2025 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants