Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] stock: create picking on mobile #144282

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Nov 29, 2023

Before this commit, it was not possible to create a new picking on mobile if this picking has multiple moves.

How to reproduce:

  • Open Odoo on mobile (or on desktop but simulate mobile device with devtools);
  • Inventory > Operations > Transfers;
  • Create a new transfer (a receipt for example);
  • In its operations (moves), add a new product, then add a second product.
  • Try to save or validate the picking -> A warning prevent to do it, saying you're trying to write on the field product_qty instead of the field product_uom_qty.

What's happening:
For a unknown reason, the fields from the stock.move list view are saved once a second move is created, even if we're using the kanban view in the mobile version.
To avoid this issue, we force the force_save to be false for the field product_qty in the kanban view. That's way, it prevents the issue.

OPW-3577844

Forward-Port-Of: #143776

@robodoo
Copy link
Contributor

robodoo commented Nov 29, 2023

Pull request status dashboard.

@fw-bot
Copy link
Contributor Author

fw-bot commented Nov 29, 2023

@svs-odoo @Whenrow cherrypicking of pull request #143776 failed.

stdout:

Auto-merging addons/stock/views/stock_move_views.xml
CONFLICT (content): Merge conflict in addons/stock/views/stock_move_views.xml

stderr:

20:36:22.108453 git.c:463               trace: built-in: git cherry-pick df60fa3fff36e7ec383fb9bc8995281cb89bd10f
error: could not apply df60fa3fff36... [FIX] stock: create picking on mobile
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
----------
status:

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Nov 29, 2023
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Nov 29, 2023
@svs-odoo svs-odoo force-pushed the 17.0-16.0-stock-picking-creation-on-mobile-svs-BBl2-fw branch 2 times, most recently from 908350a to d6c8621 Compare December 4, 2023 13:45
@svs-odoo
Copy link
Contributor

svs-odoo commented Dec 4, 2023

@Whenrow Something to check: this PR removed the stock.move form view defined inside the picking form view itself for performance purpose (less RPC it seems). But this form view was useful for the mobile view (we displayed it instead of the default move's form view where fields are readonly).
That said, there is other issues making this view inconvenient to use on mobile decide, even prior the v17.0

@svs-odoo svs-odoo force-pushed the 17.0-16.0-stock-picking-creation-on-mobile-svs-BBl2-fw branch 2 times, most recently from 997cb16 to 9837a96 Compare December 5, 2023 15:43
@svs-odoo svs-odoo force-pushed the 17.0-16.0-stock-picking-creation-on-mobile-svs-BBl2-fw branch from 9837a96 to 4039e2f Compare January 24, 2024 08:41
Before this commit, it was not possible to create a new picking on
mobile if this picking has multiple moves.

How to reproduce:
- Open Odoo on mobile (or on desktop but simulate mobile device with
  devtools);
- Inventory > Operations > Transfers;
- Create a new transfer (a receipt for example);
- In its operations (moves), add a new product, then add a second
  product.
- Try to save or validate the picking -> A warning prevent to do it,
  saying you're trying to write on the field `product_qty` instead of
  the field `product_uom_qty`.

What's happening:
For a unknown reason, the fields from the `stock.move` list view are
saved once a second move is created, even if we're using the kanban view
in the mobile version.
To avoid this issue, we force the `force_save` to be false for the field
`product_qty` in the kanban view. That's way, it prevents the issue.

OPW-3577844

X-original-commit: 818e7fc
@svs-odoo svs-odoo force-pushed the 17.0-16.0-stock-picking-creation-on-mobile-svs-BBl2-fw branch from 2325817 to 9b89f4b Compare January 25, 2024 12:59
The `stock.move` form view used for the detailed operation is also used
when using Odoo on a mobile device and is not usable in such case (for
example, the `product_id` is readonly.)
To fix this issue, the view is modified this way:
- The `product_id` is readonly only if the move has a id or already a
  move line (that way, the field is editable when creating a new move
  but is still readonly otherwise);
- The `move_line_ids` is readonly until the move's product is set;
- The demand qty. and the UoM are editable if the move is draft.

Also, some similar mofifications are done to the `stock.move.line` form
view too.

OPW-3577844
When creating a picking on mobile, the moves are displayed as kanban
boxes. But before this commit, only the mvoe's `quantity` is displayed,
that means when in draft, the quantity is usually at 0 and it's the
demand (`product_uom_qty`) who is relevant.

To fix that, display both fields.

Also, we display the UoM aswell if the UoM is enabled.
@svs-odoo svs-odoo force-pushed the 17.0-16.0-stock-picking-creation-on-mobile-svs-BBl2-fw branch from 9b89f4b to 9dcd878 Compare January 25, 2024 13:09
@Whenrow
Copy link
Contributor

Whenrow commented Jan 29, 2024

robodoo r+ rebase-ff

@robodoo
Copy link
Contributor

robodoo commented Jan 29, 2024

Merge method set to rebase and fast-forward.

robodoo pushed a commit that referenced this pull request Jan 29, 2024
Before this commit, it was not possible to create a new picking on
mobile if this picking has multiple moves.

How to reproduce:
- Open Odoo on mobile (or on desktop but simulate mobile device with
  devtools);
- Inventory > Operations > Transfers;
- Create a new transfer (a receipt for example);
- In its operations (moves), add a new product, then add a second
  product.
- Try to save or validate the picking -> A warning prevent to do it,
  saying you're trying to write on the field `product_qty` instead of
  the field `product_uom_qty`.

What's happening:
For a unknown reason, the fields from the `stock.move` list view are
saved once a second move is created, even if we're using the kanban view
in the mobile version.
To avoid this issue, we force the `force_save` to be false for the field
`product_qty` in the kanban view. That's way, it prevents the issue.

OPW-3577844

X-original-commit: 818e7fc
Part-of: #144282
robodoo pushed a commit that referenced this pull request Jan 29, 2024
The `stock.move` form view used for the detailed operation is also used
when using Odoo on a mobile device and is not usable in such case (for
example, the `product_id` is readonly.)
To fix this issue, the view is modified this way:
- The `product_id` is readonly only if the move has a id or already a
  move line (that way, the field is editable when creating a new move
  but is still readonly otherwise);
- The `move_line_ids` is readonly until the move's product is set;
- The demand qty. and the UoM are editable if the move is draft.

Also, some similar mofifications are done to the `stock.move.line` form
view too.

OPW-3577844

Part-of: #144282
@robodoo robodoo closed this in 1cd5414 Jan 29, 2024
@fw-bot fw-bot deleted the 17.0-16.0-stock-picking-creation-on-mobile-svs-BBl2-fw branch February 12, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants