Steps to reproduce: - Install Stock and Project - Create a new proect with current company as customer (3 dots menu on project overview to the customer) - Create a new warehouse for the current company - Error pops Bug: since commit[1] check company is enforced on the project_id field of partners in bothways when creating a new warehouse CheckCompany fields are editted on the partner if set (property_stock_customer/supplier) the issue is if the partner's company_id is False while project belongs to company "_check_company" fails Fix: Remove check company on project_ids from the partner's side and implement it as python constraint opw-3507952 [1]:https://github.com/odoo/odoo/pull/109464 closes odoo/odoo#143679 X-original-commit: 3741557dc4b5e84876247db851e9d2c862fcb93b Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com> Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
20 lines
644 B
Python
20 lines
644 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.addons.project.tests.test_project_base import TestProjectCommon
|
|
|
|
|
|
class TestProjectStock(TestProjectCommon):
|
|
def test_check_company(self):
|
|
"""
|
|
tests editing relation fields of a partner from a project
|
|
"""
|
|
self.project_pigs.partner_id = self.env['res.partner'].create({
|
|
'name': 'Jeff Delaney',
|
|
})
|
|
self.env['stock.warehouse'].create({
|
|
'name': 'Hi mom!',
|
|
'partner_id': self.project_pigs.partner_id.id,
|
|
'code': 'Fireship',
|
|
})
|