mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 20:32:06 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -11,6 +11,7 @@ from odoo import api, fields, models
|
|||
from odoo.exceptions import ValidationError, UserError
|
||||
from odoo.fields import Command
|
||||
from odoo.tools import mute_logger, SQL
|
||||
from odoo.tools.sql import table_columns
|
||||
|
||||
_logger = logging.getLogger('odoo.addons.base.partner.merge')
|
||||
|
||||
|
|
@ -89,6 +90,7 @@ class BasePartnerMergeAutomaticWizard(models.TransientModel):
|
|||
AND con.conkey[1] = att1.attnum
|
||||
AND att1.attrelid = cl1.oid
|
||||
AND cl2.relname = %s
|
||||
AND cl2.relnamespace = current_schema::regnamespace
|
||||
AND att2.attname = 'id'
|
||||
AND array_lower(con.confkey, 1) = 1
|
||||
AND con.confkey[1] = att2.attnum
|
||||
|
|
@ -107,6 +109,7 @@ class BasePartnerMergeAutomaticWizard(models.TransientModel):
|
|||
JOIN pg_attribute a ON (a.attrelid = c.conrelid AND a.attnum = cattr.attnum)
|
||||
WHERE c.contype IN ('c', 'u')
|
||||
AND r.relname = %s
|
||||
AND r.relnamespace = current_schema::regnamespace
|
||||
AND a.attname = %s
|
||||
LIMIT 1
|
||||
""", (table, column))
|
||||
|
|
@ -130,13 +133,8 @@ class BasePartnerMergeAutomaticWizard(models.TransientModel):
|
|||
if 'base_partner_merge_' in table: # ignore two tables
|
||||
continue
|
||||
|
||||
# get list of columns of current table (exept the current fk column)
|
||||
query = "SELECT column_name FROM information_schema.columns WHERE table_name LIKE '%s'" % (table)
|
||||
self.env.cr.execute(query, ())
|
||||
columns = []
|
||||
for data in self.env.cr.fetchall():
|
||||
if data[0] != column:
|
||||
columns.append(data[0])
|
||||
# get list of columns of current table (except the current fk column)
|
||||
columns = [fld for fld in table_columns(self.env.cr, table) if fld != column]
|
||||
|
||||
# do the update for the current table/column in SQL
|
||||
query_dic = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue