Skip to content

[10.0][MIG] sale_crm - #941

Merged
pedrobaeza merged 1 commit into
OCA:10.0from
ForgeFlow:10.0-sale_crm
Jul 17, 2017
Merged

[10.0][MIG] sale_crm#941
pedrobaeza merged 1 commit into
OCA:10.0from
ForgeFlow:10.0-sale_crm

Conversation

@MiquelRForgeFlow

@MiquelRForgeFlow MiquelRForgeFlow commented Jun 29, 2017

Copy link
Copy Markdown
Contributor

Added migration scripts and checked noupdate records.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As you have a field invoice_ids in sale.order, you should fill these fields from sale.order to the associated invoices.

@MiquelRForgeFlow
MiquelRForgeFlow force-pushed the 10.0-sale_crm branch 2 times, most recently from 9826e02 to 7453acf Compare June 30, 2017 10:50
@MiquelRForgeFlow MiquelRForgeFlow changed the title [10.0][MIG] sale_crm: Nothing to do [10.0][MIG] sale_crm Jun 30, 2017
@pedrobaeza

Copy link
Copy Markdown
Member

Errores de flake8:

./addons/sale_crm/migrations/10.0.1.0/post-migration.py:16:48: W291 trailing whitespace
./addons/sale_crm/migrations/10.0.1.0/post-migration.py:19:67: W291 trailing whitespace
./addons/sale_crm/migrations/10.0.1.0/post-migration.py:23:54: W291 trailing whitespace
./addons/sale_crm/migrations/10.0.1.0/post-migration.py:25:47: W291 trailing whitespace
./addons/sale_crm/migrations/10.0.1.0/post-migration.py:26:45: W291 trailing whitespace

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to make subquery:

        UPDATE account_invoice ai
        SET campaign_id = so.campaign_id,
            medium_id = so.medium_id,
            source_id = so.source_id
        FROM account_invoice_line ail,
        sale_order_line sol,
        sale_order so,
        sale_order_line_invoice_rel rel
        WHERE ai.id = ail.invoice_id
        AND ail.id = rel.invoice_line_id
        AND rel.order_line_id = sol.id
        AND sol.order_id = so.id

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm thinking in one last thing: better to call openupgrade.logged_query instead a plain cr.execute to register the operation in the log.

@pedrobaeza
pedrobaeza merged commit ed179fb into OCA:10.0 Jul 17, 2017
@MiquelRForgeFlow
MiquelRForgeFlow deleted the 10.0-sale_crm branch July 21, 2017 10:52
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.

2 participants