mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] purchase_by_sale_history: To 16 error on _sale_history method relation with sale_report not exist
This commit is contained in:
@@ -53,12 +53,12 @@ class TestPurchaseBySaleHistory(common.TransactionCase):
|
||||
|
||||
# Assign vendor to products created earlier.
|
||||
self.env['product.supplierinfo'].create({
|
||||
'name': purchase_partner.id,
|
||||
'partner_id': purchase_partner.id,
|
||||
'product_tmpl_id': product11.product_tmpl_id.id,
|
||||
'product_id': product11.id,
|
||||
})
|
||||
self.env['product.supplierinfo'].create({
|
||||
'name': purchase_partner.id,
|
||||
'partner_id': purchase_partner.id,
|
||||
'product_tmpl_id': product2.product_tmpl_id.id,
|
||||
})
|
||||
# New wizard picks up the correct number of products supplied by this vendor.
|
||||
|
||||
@@ -40,8 +40,8 @@ class PurchaseBySaleHistory(models.TransientModel):
|
||||
self.env.cr.execute("""SELECT COUNT(DISTINCT(psi.product_id)) + COUNT(DISTINCT(p.id))
|
||||
FROM product_supplierinfo psi
|
||||
LEFT JOIN product_product p ON p.product_tmpl_id = psi.product_tmpl_id AND psi.product_id IS NULL
|
||||
WHERE psi.name = %d;"""
|
||||
% (wiz.purchase_id.partner_id.id, ))
|
||||
WHERE psi.partner_id = %s;""",
|
||||
(wiz.purchase_id.partner_id.id,))
|
||||
wiz.product_count = self.env.cr.fetchall()[0][0]
|
||||
|
||||
def _history_product_ids(self):
|
||||
@@ -51,8 +51,8 @@ class PurchaseBySaleHistory(models.TransientModel):
|
||||
self.env.cr.execute("""SELECT DISTINCT(COALESCE(psi.product_id, p.id))
|
||||
FROM product_supplierinfo psi
|
||||
LEFT JOIN product_product p ON p.product_tmpl_id = psi.product_tmpl_id AND psi.product_id IS NULL
|
||||
WHERE psi.name = %d;"""
|
||||
% (self.purchase_id.partner_id.id, ))
|
||||
WHERE psi.partner_id = %s;""",
|
||||
(self.purchase_id.partner_id.id,))
|
||||
rows = self.env.cr.fetchall()
|
||||
return [r[0] for r in rows if r[0]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user