[ADD] account_payment_extension: Migration scripts to bank-payment modules - #35
Merged
pedrobaeza merged 2 commits intoMar 24, 2016
Merged
Conversation
pedrobaeza
force-pushed
the
8.0-account_payment_extension-migration
branch
2 times, most recently
from
July 6, 2015 16:10
cc78e79 to
86b3faa
Compare
pedrobaeza
force-pushed
the
8.0-account_payment_extension-migration
branch
6 times, most recently
from
August 18, 2015 18:59
4529e13 to
d247942
Compare
Member
|
👍 |
pedrobaeza
force-pushed
the
8.0-account_payment_extension-migration
branch
from
November 6, 2015 01:26
d247942 to
5f494e2
Compare
pedrobaeza
force-pushed
the
8.0-account_payment_extension-migration
branch
5 times, most recently
from
January 27, 2016 13:07
b86e371 to
ff4fbf3
Compare
| VALUES (%%s, %%s, %%s, %%s, %%s) | ||
| RETURNING id;""" % openupgrade.get_legacy_name('type'), | ||
| (payment_type[0], payment_type[1], payment_type[2], | ||
| journal_id, bank_id, company_id)) |
Member
There was a problem hiding this comment.
This pull works like a charm but I've had to change this insert code in order to be able to run it. For me works this:
# Create the payment mode
cr.execute(
"""
INSERT INTO payment_mode
(id, name, active, journal, bank_id, company_id)
VALUES (%s, '%s', %s, %s, %s, %s)
RETURNING id;""" %
(payment_type[0], payment_type[1], payment_type[2],
journal_id, bank_id, company_id,))
Member
Author
There was a problem hiding this comment.
What is the error? I think this is because and old PG version, and with that SQL, you can overwrite some id values.
Member
There was a problem hiding this comment.
I've got two errors. One is easy:
openerp.sql_db: bad query:
INSERT INTO payment_mode
(openupgrade_legacy_8_0_type, name, active, journal, bank_id, company_id)
VALUES (%s, %s, %s, %s, %s)
RETURNING id;
Traceback (most recent call last):
File "/home/cubells/projectes/git/odoo80/8.0/server/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
TypeError: not all arguments converted during string formatting
The second is the error that made me to change the insert code:
2016-02-10 05:06:17,078 15371 ERROR openerp.sql_db: Programming error: column "openupgrade_legacy_8_0_type" of relation "payment_mode" does not exist
LINE 3: (openupgrade_legacy_8_0_type, name, acti...
^
, in query
INSERT INTO payment_mode
(openupgrade_legacy_8_0_type, name, active, journal, bank_id, company_id)
VALUES (%s, %s, %s, %s, %s, %s)
RETURNING id;
…ion scripts Dummy modules with migration scripts that allows to migrate to bank-payment suite.
pedrobaeza
force-pushed
the
8.0-account_payment_extension-migration
branch
from
March 7, 2016 18:02
844984f to
d56f73f
Compare
Member
Author
|
@cubells, the correct SQL statement has been fixed in pedrobaeza@d56f73f |
Member
Author
|
As all comments have been honoured and the Travis problem is unrelated, I merge this one to have it finally on the repo. |
|
Arg, too late... I found a bug and was not able to find your branch anymore ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration scripts for account_payment_extension v7 set of modules
This module includes the needed migration script for making a smooth transition
from v7 account_payment_extension module to the set of v8 bank-payment
modules.
This module doesn't provide any functionality at user level.
Installation
You need OpenUpgrade for using these scripts. Put this module in a path
included on OpenUpgrade addons path. You need also to have accesible the
repository bank-payment from https://github.com/OCA/bank-payment.
Start the OpenUpgrade migration and the conversion will be automatically done,
and this module will be automatically uninstall.