Skip to content

[13.0][MIG] stock_dropshipping#2379

Merged
pedrobaeza merged 3 commits intoOCA:13.0from
ForgeFlow:13.0-mig-stock_dropshipping-script
Oct 6, 2021
Merged

[13.0][MIG] stock_dropshipping#2379
pedrobaeza merged 3 commits intoOCA:13.0from
ForgeFlow:13.0-mig-stock_dropshipping-script

Conversation

@MiquelRForgeFlow
Copy link
Contributor

Migration of stock_dropshipping.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@MiquelRForgeFlow MiquelRForgeFlow added this to the 13.0 milestone Aug 4, 2020
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 13.0-mig-stock_dropshipping-script branch 2 times, most recently from 7751c86 to 1c08288 Compare January 22, 2021 21:45
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 13.0-mig-stock_dropshipping-script branch 2 times, most recently from 3f076d6 to 70446a0 Compare February 3, 2021 11:32
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 13.0-mig-stock_dropshipping-script branch 3 times, most recently from 24d38f6 to bee84ad Compare May 14, 2021 16:11
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 13.0-mig-stock_dropshipping-script branch from bee84ad to f043669 Compare June 30, 2021 15:19
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Can you please explain the general strategy here? I see a lot of code with barely indications and I sincerely don't understand why all of this is needed.

@MiquelRForgeFlow
Copy link
Contributor Author

MiquelRForgeFlow commented Sep 28, 2021

The general strategy here is similar to https://github.com/OCA/OpenUpgrade/blob/13.0/addons/stock/migrations/13.0.1.1/post-migration.py#L234, which it's to generate dropship sequences for each company an adapt existing models that point to default sequence to the new sequence, and similar with dropship picking types and stock rules that are dependent of those sequences.

@pedrobaeza
Copy link
Member

pedrobaeza commented Sep 29, 2021

I have rebased, and added on top these changes:

  • Don't change current preferences on picking type code/sequence prefix.
  • Keep current record for first company and duplicate it for the rest.
  • Save mapping of records for later references.
  • Use smart foreign key reference replacing for extra created records.

This depends on OCA/openupgradelib#246, but I have pushed an extra commit that should be removed when merged for testing if all goes good. I think this strategy can be used also in stock script for simplifying things and covering more cases.

@Tecnativa TT28115

@pedrobaeza pedrobaeza force-pushed the 13.0-mig-stock_dropshipping-script branch from b0706d8 to 4b9d853 Compare September 29, 2021 17:28
- Don't change current preferences on picking type code/sequence prefix.
- Keep curent record for first company and duplicate it for the rest.
- Save mapping of records for later references.
- Use smart foreign key reference replacing for extra created records.

TT28115
We use the existing sequences for detecting this code.
@pedrobaeza pedrobaeza force-pushed the 13.0-mig-stock_dropshipping-script branch 2 times, most recently from 81d2b53 to 7be23b7 Compare October 6, 2021 09:26
@pedrobaeza pedrobaeza merged commit ef58eba into OCA:13.0 Oct 6, 2021
@pedrobaeza pedrobaeza deleted the 13.0-mig-stock_dropshipping-script branch October 6, 2021 10:09
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.

2 participants