تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3439 أدوات العرض

Hi Team

I have accidently added a branch into my Odoo account besides the main company. 
Irony is that they both are named same.

When I try deleting it, the error says  

Model: Picking Type (stock.picking.type)
Constraint: stock_picking_type_company_id_fkey

I also can't delete the user as it is associated with the main company. It gives the following error

Model: Contact (res.partner) 
Constraint: res_partner_write_uid_fkey

I have gone to an extra length and thought to delete the whole company including the branch. But the system won't let me do that either and returns 

Model: User (res.users) 
Constraint: res_users_company_id_fkey

Just to be clear, I'm subscribed to standard online Odoo version. 

Thanks 
Mus


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Once a company is created, we will not be able to delete it as dependencies are created in the system. As per the error message, it seems you have some records in the table/model:  stock.picking.type and res.partner, having company_id value set to this company.
So clear those records or instead of deleting keep the company archived.


Hope it helps

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

I understand but this not a company, it is a branch, and it can't be archived.

Regarding the dependency, as the error suggested 'stock.picking.type', I tried archiving all the inventory and then deleted the branch, but it still had the same issue. 

Thanks


الصورة الرمزية
إهمال
الكاتب

Found the answer.

Simply go to debug mode and archive the branch from there.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 24
2877
1
أكتوبر 19
5362
2
يناير 25
4351
2
أغسطس 22
10281
1
يوليو 24
3164