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

[16.0] [MIG] shopinvader_sale_packaging #1400

Closed

Conversation

marielejeune
Copy link
Contributor

@marielejeune marielejeune commented Sep 5, 2023

  1. Split this module into 2 modules:
  • shopinvader_product_sale_packaging to add packaging info into search engine schemas
  • shopinvader_restapi_sale_packaging to allow rest services to purchase products by packaging.
  1. When migrating from v14 to v16 model product.packaging.type was renamed product.packaging.level. Adapt all the references.

Depends on

TODO

  • Remove modifications in test-requirements.txt when dependencies will be merged.

@marielejeune marielejeune force-pushed the 16.0-mig-shopinvader_sale_packaging branch 2 times, most recently from 9044b08 to a6e7983 Compare September 5, 2023 14:15
# consider only packaging that can be displayed
"_packaging_filter": lambda x: x.shopinvader_display,
"_packaging_values_handler": self._prepare_qty_by_packaging_values,
}

def _prepare_qty_by_packaging_values(self, packaging, qty_per_pkg):
# TODO: why re-define? Duplicate of stock_packaging_calculator/models/product.py L147
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure to understand why this method is redefined here as it is a duplicate of stock_packaging_calculator/models/product.py (L147), already in v14.

@marielejeune marielejeune force-pushed the 16.0-mig-shopinvader_sale_packaging branch from a6e7983 to d8e63e4 Compare September 13, 2023 13:35
return {
"lang": self.lang_id.code,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

How to deal with user lang now that we don't have it from the backend anymore?

@marielejeune
Copy link
Contributor Author

marielejeune commented Sep 15, 2023

In add_item service item_qty is a required field. But when providing a package_id and package_qty, this field shouldn't be required anymore otherwise when a dummy value is passed, it prevents onchanges to be played correctly and compute product_uom_qty.
We thus add in e024319 a workaround to remove product_uom_qty from vals when packaging id and quantity are given.

@marielejeune marielejeune force-pushed the 16.0-mig-shopinvader_sale_packaging branch 2 times, most recently from e024319 to d85a170 Compare September 18, 2023 15:49
@marielejeune marielejeune force-pushed the 16.0-mig-shopinvader_sale_packaging branch from d85a170 to 5784676 Compare September 19, 2023 09:08
/>
<field name="arch" type="xml">
<field name="force_sale_qty" position="after">
<!-- TODO: group on this field was shopinvader.group_shopinvader_manager-->
<field name="shopinvader_display" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both fields added in this view were restricted to shopinvader.group_shopinvader_manager group. Now this group moved to shopinvader_restapi, but our addon shouldn't depend on shopinvader_restapi just for a security group...

@marielejeune marielejeune marked this pull request as ready for review September 21, 2023 07:33
@sebastienbeau sebastienbeau added this to the 16.0 milestone Sep 25, 2023
@marielejeune
Copy link
Contributor Author

Divided into #1415 and #1416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants