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

[17.0][MIG] delivery_package_number: Migration to 17.0 #839

Merged
merged 18 commits into from
Nov 29, 2024

Conversation

Josep-s73
Copy link

Standard migration to 17.0

Copy link
Member

@hildickethan hildickethan left a comment

Choose a reason for hiding this comment

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

code + functional

@@ -10,14 +10,13 @@
"license": "AGPL-3",
"installable": True,
"application": False,
"depends": ["delivery"],
"depends": ["delivery", "stock_delivery"],
Copy link
Member

Choose a reason for hiding this comment

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

Why this new dependency?

Copy link
Member

Choose a reason for hiding this comment

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

it's a new glue module for pickings + delivery, the base delivery only handles the carrier models and adds shipping methods to sales now. Though the depends could be abbreviated to just ["stock_delivery"]

Copy link
Member

Choose a reason for hiding this comment

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

OK, I see. Maybe we should rename this to stock_delivery_package_number? cc @chienandalu @sergio-teruel

Copy link
Member

Choose a reason for hiding this comment

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

Odoo hasn't renamed any of their modules to stock_delivery_x so far, not even another glue module delivery_stock_picking_batch. I think it would more consistent to keep the current delivery_x naming

Copy link
Member

Choose a reason for hiding this comment

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

I'd keep it in the short form as well....

@pedrobaeza
Copy link
Member

/ocabot migration delivery_package_number

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Jul 8, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Jul 8, 2024
26 tasks
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

There are pending forward ports in v16 as well: #788

ping @sergio-teruel

@sergio-teruel
Copy link
Contributor

Hi @Josep-s73 , Can you add this commits from 16??

Thanks

  • [IMP] delivery_package_number: Make compatible with multi pickings validatio(aa27ae4)
  • [IMP] delivery_package_number: Ask only once for the number of packages wizard (5f3ca59)
  • [FIX] delivery_package_number: download label (1274e99)

chienandalu and others added 13 commits November 26, 2024 17:20
[UPD] Update delivery_package_number.pot

[UPD] README.rst
[UPD] Update delivery_package_number.pot

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: delivery-carrier-14.0/delivery-carrier-14.0-delivery_package_number
Translate-URL: https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_package_number/
…ransfer wizard if picking have not carrier.

TT38549
@pablo-cort-s73 pablo-cort-s73 force-pushed the 17.0-mig-delivery_package_number branch 2 times, most recently from deaa126 to e37c6da Compare November 26, 2024 16:56
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

There are still missing commits from v16. You can simply fetch a fresh v16 branch and redo the initial migration steps and then cherry pick your migration commit

name="number_of_packages"
attrs="{'readonly': [('state', '=', 'done')]}"
/>
<field name="number_of_packages" readonly="state == 'done'" />
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<field name="number_of_packages" readonly="state == 'done'" />
<field name="number_of_packages" readonly="state == 'done'" />

@@ -7,19 +7,19 @@
<field name="arch" type="xml">
<xpath expr="//footer" position="before">
<field name="ask_number_of_packages" invisible="1" />
<group attrs="{'invisible': [('ask_number_of_packages','=',False)]}">
<group invisible="ask_number_of_packages == False">
Copy link
Member

Choose a reason for hiding this comment

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

I like to rely on coercion of truthy / falsey values. I.e.: None is falsey but isn't equal to False. It's also more semantic

Suggested change
<group invisible="ask_number_of_packages == False">
<group invisible="not ask_number_of_packages">

<field name="number_of_packages" />
</group>
</xpath>
<xpath expr="//button[@special='cancel']" position="after">
<field
name="print_package_label"
widget="boolean_toggle"
attrs="{'invisible': [('ask_number_of_packages','=',False)]}"
invisible="ask_number_of_packages == False"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
invisible="ask_number_of_packages == False"
invisible="not ask_number_of_packages"

/>
<label
for="print_package_label"
attrs="{'invisible': [('ask_number_of_packages','=',False)]}"
invisible="ask_number_of_packages == False"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
invisible="ask_number_of_packages == False"
invisible="not ask_number_of_packages"

@@ -10,14 +10,13 @@
"license": "AGPL-3",
"installable": True,
"application": False,
"depends": ["delivery"],
"depends": ["delivery", "stock_delivery"],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"depends": ["delivery", "stock_delivery"],
"depends": ["stock_delivery"],

@pablo-cort-s73 pablo-cort-s73 force-pushed the 17.0-mig-delivery_package_number branch 2 times, most recently from 9e8c795 to 563a0f8 Compare November 27, 2024 10:55
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Aside from the code remarks, the package number wizard isn't showing up correctly

image

@@ -9,13 +9,13 @@
<group>
<field
name="number_of_packages"
attrs="{'invisible': [('stock_number_package_validation_line_ids', '!=', [])]}"
invisible="stock_number_package_validation_line_ids != []"
Copy link
Member

Choose a reason for hiding this comment

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

This is why you should rely on python boolean coercion. This will allways be invisible with this condition

Suggested change
invisible="stock_number_package_validation_line_ids != []"
invisible="stock_number_package_validation_line_ids"

attrs="{'invisible': [('stock_number_package_validation_line_ids', '=', [])]}"
invisible="stock_number_package_validation_line_ids == []"
Copy link
Member

Choose a reason for hiding this comment

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

The same goes for this one. This will never be invisible.

Suggested change
attrs="{'invisible': [('stock_number_package_validation_line_ids', '=', [])]}"
invisible="stock_number_package_validation_line_ids == []"
invisible="not stock_number_package_validation_line_ids"

Comment on lines 84 to 87
<<<<<<< HEAD
* Pedro M. Baeza
* David Vidal
* Carlos Roca
* Sergio Teruel
- Pedro M. Baeza
- David Vidal
- Marçal Isern
- Carlos Roca
Copy link
Member

Choose a reason for hiding this comment

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

You should have resolve merge conflicts in the previous commit and don't let them show in the diff...

Comment on lines 15 to 31
<group>
<field
name="stock_number_package_validation_line_ids"
invisible="not stock_number_package_validation_line_ids"
nolabel="1"
>
<tree create="0" delete="0" editable="1">
<field
name="picking_id"
options="{'no_open': True}"
readonly="1"
force_save="1"
/>
<field name="number_of_packages" />
</tree>
</field>
</group>
Copy link
Member

Choose a reason for hiding this comment

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

To show the picking list correctly when validating package numbers in bulk

Suggested change
<group>
<field
name="stock_number_package_validation_line_ids"
invisible="not stock_number_package_validation_line_ids"
nolabel="1"
>
<tree create="0" delete="0" editable="1">
<field
name="picking_id"
options="{'no_open': True}"
readonly="1"
force_save="1"
/>
<field name="number_of_packages" />
</tree>
</field>
</group>
<field
name="stock_number_package_validation_line_ids"
invisible="not stock_number_package_validation_line_ids"
nolabel="1"
>
<tree create="0" delete="0" editable="1">
<field
name="picking_id"
options="{'no_open': True}"
readonly="1"
force_save="1"
/>
<field name="number_of_packages" />
</tree>
</field>

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-839-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 9593b9d. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit eef7866 into OCA:17.0 Nov 29, 2024
7 checks passed
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.