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

[10.0] [MIG] stock_picking_variant_mgmt: Migration to 10.0 #84

Merged
merged 3 commits into from
Nov 29, 2017

Conversation

pedrobaeza
Copy link
Member

  • Standard migration
  • Tests adapted

@Tecnativa

pedrobaeza and others added 2 commits October 27, 2017 22:20
=================================================
Handle easily multiple variants on Stock Pickings
=================================================

This module allows to add/modify of all the variants of a product in a direct
screen without the need of handling them one by one.

It also adds a convenient way of handling the transfer of the products in a
2D matrix with all the values of the first attribute in columns, and the
rest of the combinations in rows.

Configuration
=============

* Configure your user to have any permission from "Inventory" group.
* Create a product with 2 attributes and several values.

Usage
=====

* Go to Inventory > Dashboard.
* Create a new picking from one of the existing picking types.
* Press "Add variants" button located in the upper right corner of the
  "Initial Demand" tab.
* A new screen will appear allowing you to select the products that have
  variants.
* Once you select the product, a 2D matrix will appear with the first
  attribute values as columns and the second one (if any) as rows.
* If there are already order lines for the product variants, the current
  quantity will be pre-filled in the matrix.
* Change the quantities for the variant you want and click on "Transfer to
  picking"
* Move lines for the variants will be created/removed to comply with the
  input you have done.

As extra feature for saving steps, there's also a button on each existing line
that corresponds to a variant that opens the dialog directly with the product
selected.

You are also able to manage variants on 1 dimension in the transfer:

* Go to the "Operations" page.
* Press on "Manage Variants Transfer" button in the upper right corner of the
  tab.
* Change the quantities to transfer.
* Click on "Transfer to picking" button.

Known issues / Roadmap
======================

* The inline button for modifying quantities for an existing line won't
  work correctly until these 2 PRs are merged in Odoo:

  * odoo/odoo#13557
  * odoo/odoo#13635

  The patches are already integrated on OCB.

* Make this work with product with more than 1 attribute.
Copy link

@carlosdauden carlosdauden left a comment

Choose a reason for hiding this comment

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

Code LGTM.

Testing in runbot shows intermittent error when click in new matrix button of picking line:
Uncaught TypeError: Cannot read property 'type' of undefined
http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/474-bfd16b8/web.assets_backend.js:4101 Traceback: TypeError: Cannot read property 'type' of undefined at Class.format_xy_value (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/474-bfd16b8/web.assets_backend.js:4101:72) at Class.compute_totals (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/474-bfd16b8/web.assets_backend.js:4105:142) at Class.start (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/474-bfd16b8/web.assets_backend.js:4112:90) at Class.prototype.(anonymous function) [as start] (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/468-bf677a6/web.assets_common.js:3010:559) at http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/468-bf677a6/web.assets_common.js:3113:963 at http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/468-bf677a6/web.assets_common.js:547:681 at fire (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/468-bf677a6/web.assets_common.js:541:299) at Object.add [as done] (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/468-bf677a6/web.assets_common.js:542:467) at Array.<anonymous> (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/468-bf677a6/web.assets_common.js:547:649) at Function.each (http://3308592-84-152fd1.runbot1.odoo-community.org/web/content/468-bf677a6/web.assets_common.js:370:767)

Can be related with known issues, but v10?

@pedrobaeza
Copy link
Member Author

That's because it's not OCB. Please read known issues section of the README.

@carlosdauden
Copy link

Precisely because I read known issues I asked this:

Can be related with known issues, but v10?

This section has 1 v8 PR reference and 1 v9 PR reference:

@pedrobaeza
Copy link
Member Author

pedrobaeza commented Oct 30, 2017

For v10 I declined to do it again, as it was rejected in previous versions.


The patches are already integrated on OCB.

* Make this work with products with more than 1 attribute.
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this, You can use with one attribute too.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the issue is correct. See that it puts "more than 1 attribute", which is the problem indeed in the transfer dialog. I will be any way more specific.

'stock',
'web_widget_x2many_2d_matrix',
],
'demo': [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove empty key

options="{'no_create': True}"
/>
</group>
<field name="variant_line_ids"
Copy link
Contributor

Choose a reason for hiding this comment

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

Put this field inside a group with nolabel, now the field appears in small area.

@pedrobaeza pedrobaeza force-pushed the 10.0-stock_picking_variant_mgmt branch from 123a53c to e4b0306 Compare October 30, 2017 17:19
@pedrobaeza
Copy link
Member Author

@sergio-teruel changes done

@sergio-teruel
Copy link
Contributor

Only one question about JS error ... is not very usable.. ¿the v9 commit would be for v10?

@pedrobaeza
Copy link
Member Author

In OCB v10 it's already integrated.

@pedrobaeza pedrobaeza force-pushed the 10.0-stock_picking_variant_mgmt branch from e4b0306 to ebb1c4e Compare November 29, 2017 08:12
@pedrobaeza pedrobaeza merged commit a5ceb71 into OCA:10.0 Nov 29, 2017
@pedrobaeza pedrobaeza deleted the 10.0-stock_picking_variant_mgmt branch November 29, 2017 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants