Skip to content

Conversation

@yankinmax
Copy link
Contributor Author

The tests are failing because of the issue I've mentioned in this PR (delivery_postlogistics)

@rousseldenis
Copy link
Contributor

/ocabot migration delivery_carrier_label_batch

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Feb 17, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Feb 17, 2025
36 tasks
@yankinmax yankinmax force-pushed the 18.0-mig-delivery_carrier_label_batch branch 4 times, most recently from a17288a to dd119da Compare February 20, 2025 13:52
@yankinmax yankinmax force-pushed the 18.0-mig-delivery_carrier_label_batch branch 3 times, most recently from ca31b7c to e3888d0 Compare February 24, 2025 08:40
@yankinmax yankinmax force-pushed the 18.0-mig-delivery_carrier_label_batch branch from e3888d0 to 823ed3d Compare February 24, 2025 14:29
@StephaneMangin
Copy link
Contributor

delivery_postlogistics is a final module, why do you need to inherit from it?

@yankinmax
Copy link
Contributor Author

@StephaneMangin if the field parcel_tracking = fields.Char() is defined in postlogistics I need to inherit

@yankinmax yankinmax force-pushed the 18.0-mig-delivery_carrier_label_batch branch 5 times, most recently from af1f057 to 3a334de Compare April 1, 2025 06:02
@yankinmax
Copy link
Contributor Author

NOTE for reviewers
Tests are failing and BTW not even run, because of Deprecation Warnings coming from delivery_postlogistics.
Locally tested and should be ok.

@yankinmax yankinmax force-pushed the 18.0-mig-delivery_carrier_label_batch branch 2 times, most recently from 45402db to f9dd62d Compare May 9, 2025 11:45
@Camille0907 Camille0907 force-pushed the 18.0-mig-delivery_carrier_label_batch branch from f9dd62d to 41e34c7 Compare May 20, 2025 16:41
@yankinmax yankinmax force-pushed the 18.0-mig-delivery_carrier_label_batch branch 2 times, most recently from a7620be to b73431c Compare May 26, 2025 07:19
@yankinmax yankinmax force-pushed the 18.0-mig-delivery_carrier_label_batch branch from b73431c to adba048 Compare May 26, 2025 08:36
@yankinmax
Copy link
Contributor Author

Hi @yankinmax How are you ? You can pull this dependency to avoid depending from postlogistics #983 I'll manage a PR to remove this field from postlogistics. For now it should not be a problem to have this field on two different modules if the signature of the field is the same during the change (should be though, like so parcel_tracking = fields.Char())

Hello @StephaneMangin , I'm fine, thanks, hope you're too 😄
Do I correctly understand you: you suggest removing delivery_postlogitics dependency in favor of delivery_carrier_package_info?
It looks logical for me.
I've updated my migration.

@StephaneMangin
Copy link
Contributor

Hi @yankinmax How are you ? You can pull this dependency to avoid depending from postlogistics #983 I'll manage a PR to remove this field from postlogistics. For now it should not be a problem to have this field on two different modules if the signature of the field is the same during the change (should be though, like so parcel_tracking = fields.Char())

Hello @StephaneMangin , I'm fine, thanks, hope you're too 😄 Do I correctly understand you: you suggest removing delivery_postlogitics dependency in favor of delivery_carrier_package_info? It looks logical for me. I've updated my migration.

Yes that's it. Thanks

@Camille0907
Copy link
Contributor

Camille0907 commented Jun 13, 2025

FTR the force-push made today adds this commit to fix an assignation to a field that doesn't exist (anymore ?)

[EDIT] Re-added here

Hello, the commit mentioned in my previous message disappeared, probably during a force-push 🤔
I'm about to re-add it

Please try to keep it during next force-push 😉

@yankinmax
Copy link
Contributor Author

yankinmax commented Jun 13, 2025 via email

…er_code`

    This line has been added by OCA@3b0232d but it looks like the field carrier_code has never been added to the model (or at least it has never been merged in the OCA repo?), thus we get following error when updating the ``carrier_id``:
    ```
    [...]
      File "/odoo/src/addons/web/models/models.py", line 1005, in onchange
        record._apply_onchange_methods(field_name, result)
      File "/odoo/src/odoo/models.py", line 7364, in _apply_onchange_methods
        res = method(self)
              ^^^^^^^^^^^^
      File "/odoo/external-src/delivery-carrier/delivery_carrier_label_batch/models/stock_batch_picking.py", line 61, in onchange_carrier_id
        self.carrier_code = self.carrier_id.code
        ^^^^^^^^^^^^^^^^^
    AttributeError: 'stock.picking.batch' object has no attribute 'carrier_code'

    The above server error caused the following client error:
    RPC_ERROR: Odoo Server Error
        RPC_ERROR
            at makeErrorFromResponse (http://localhost:8069/web/assets/e5ed061/web.assets_web.min.js:3144:163)
            at XMLHttpRequest.<anonymous> (http://localhost:8069/web/assets/e5ed061/web.assets_web.min.js:3149:13)
    ```
@Camille0907 Camille0907 force-pushed the 18.0-mig-delivery_carrier_label_batch branch 2 times, most recently from c2868d9 to f358f74 Compare June 17, 2025 13:21
Camille0907 and others added 2 commits June 17, 2025 15:27
… by ``UserError.args[0]``

In the label generation, when getting an error, we were using its ``name``, however, this is deprecated since a while and as been removed in odoo/odoo@d200dcf.
We should use ``args[0]`` instead.
@Camille0907 Camille0907 force-pushed the 18.0-mig-delivery_carrier_label_batch branch from f358f74 to 99c171c Compare June 17, 2025 13:27
@Camille0907
Copy link
Contributor

Hello, my new force-push is to add another commit: f0f852e

It fixes a traceback appearing when we manage errors happening during label generation

We might want to squash it with the migration commit ?

Camille0907 and others added 3 commits July 11, 2025 16:04
… return ``stock.move.line`` records instead of an Iterator

All calls to this method expect ``stock.move.line`` records.
Regenerating the carrier labels would crash with a Concurent Update
error.

We use a new cursor for tracking reference purge and avoid concurrent update
when the labels regeneration also updates that field in a separate
cursor afterwards: this ensures that the purge is committed before the
transactions created by the threads also update and commit their own
changes.
Don't spawn more threads than needed: if there are fewer groups to
process than the configured max number of threads, only start the
specified number of threads.
@gurneyalex
Copy link
Member

@yankinmax @Camille0907 I just pushed 2 new commits on this PR

@yankinmax
Copy link
Contributor Author

@yankinmax @Camille0907 I just pushed 2 new commits on this PR

Thanks @gurneyalex

)
raise exceptions.UserError(msg)

def action_generate_labels(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason, the labels generated aren't ordered as expected.
Does anyone using this module have the same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.