-- Name: gamification_challenge gamification_challenge_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_goal gamification_goal_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_challenge_id_fkey FOREIGN KEY (challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE SET NULL;


--
-- Name: gamification_goal gamification_goal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_action_id_fkey FOREIGN KEY (action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_batch_distinctive_field_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_batch_distinctive_field_fkey FOREIGN KEY (batch_distinctive_field) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_field_date_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_field_date_id_fkey FOREIGN KEY (field_date_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: gamification_goal gamification_goal_definition_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_definition_id_fkey FOREIGN KEY (definition_id) REFERENCES public.gamification_goal_definition(id) ON DELETE CASCADE;


--
-- Name: gamification_goal_definition gamification_goal_definition_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: gamification_goal_definition gamification_goal_definition_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_goal gamification_goal_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.gamification_challenge_line(id) ON DELETE CASCADE;


--
-- Name: gamification_goal gamification_goal_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: gamification_goal_wizard gamification_goal_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_wizard
    ADD CONSTRAINT gamification_goal_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_wizard gamification_goal_wizard_goal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_wizard
    ADD CONSTRAINT gamification_goal_wizard_goal_id_fkey FOREIGN KEY (goal_id) REFERENCES public.gamification_goal(id) ON DELETE CASCADE;


--
-- Name: gamification_goal_wizard gamification_goal_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_wizard
    ADD CONSTRAINT gamification_goal_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_goal gamification_goal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_invited_user_ids_rel gamification_invited_user_ids_re_gamification_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_invited_user_ids_rel
    ADD CONSTRAINT gamification_invited_user_ids_re_gamification_challenge_id_fkey FOREIGN KEY (gamification_challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE CASCADE;


--
-- Name: gamification_invited_user_ids_rel gamification_invited_user_ids_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_invited_user_ids_rel
    ADD CONSTRAINT gamification_invited_user_ids_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: gamification_karma_rank gamification_karma_rank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_karma_rank
    ADD CONSTRAINT gamification_karma_rank_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_karma_rank gamification_karma_rank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_karma_rank
    ADD CONSTRAINT gamification_karma_rank_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_karma_tracking gamification_karma_tracking_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_karma_tracking
    ADD CONSTRAINT gamification_karma_tracking_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_karma_tracking gamification_karma_tracking_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_karma_tracking
    ADD CONSTRAINT gamification_karma_tracking_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: gamification_karma_tracking gamification_karma_tracking_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_karma_tracking
    ADD CONSTRAINT gamification_karma_tracking_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: hr_contract hr_contract_contract_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_contract_type_id_fkey FOREIGN KEY (contract_type_id) REFERENCES public.hr_contract_type(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_hr_responsible_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_hr_responsible_id_fkey FOREIGN KEY (hr_responsible_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_job_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_job_id_fkey FOREIGN KEY (job_id) REFERENCES public.hr_job(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_resource_calendar_id_fkey FOREIGN KEY (resource_calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_structure_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_structure_type_id_fkey FOREIGN KEY (structure_type_id) REFERENCES public.hr_payroll_structure_type(id) ON DELETE SET NULL;


--
-- Name: hr_contract_type hr_contract_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract_type
    ADD CONSTRAINT hr_contract_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_contract_type hr_contract_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract_type
    ADD CONSTRAINT hr_contract_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_contract hr_contract_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_contract
    ADD CONSTRAINT hr_contract_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_department_mail_channel_rel hr_department_mail_channel_rel_hr_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department_mail_channel_rel
    ADD CONSTRAINT hr_department_mail_channel_rel_hr_department_id_fkey FOREIGN KEY (hr_department_id) REFERENCES public.hr_department(id) ON DELETE CASCADE;


--
-- Name: hr_department_mail_channel_rel hr_department_mail_channel_rel_mail_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department_mail_channel_rel
    ADD CONSTRAINT hr_department_mail_channel_rel_mail_channel_id_fkey FOREIGN KEY (mail_channel_id) REFERENCES public.mail_channel(id) ON DELETE CASCADE;


--
-- Name: hr_department hr_department_manager_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_manager_id_fkey FOREIGN KEY (manager_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_master_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_master_department_id_fkey FOREIGN KEY (master_department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_departure_reason hr_departure_reason_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_reason
    ADD CONSTRAINT hr_departure_reason_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_departure_reason hr_departure_reason_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_reason
    ADD CONSTRAINT hr_departure_reason_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_departure_wizard hr_departure_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_wizard
    ADD CONSTRAINT hr_departure_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_departure_wizard hr_departure_wizard_departure_reason_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_wizard
    ADD CONSTRAINT hr_departure_wizard_departure_reason_id_fkey FOREIGN KEY (departure_reason_id) REFERENCES public.hr_departure_reason(id) ON DELETE CASCADE;


--
-- Name: hr_departure_wizard hr_departure_wizard_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_wizard
    ADD CONSTRAINT hr_departure_wizard_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_departure_wizard hr_departure_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_wizard
    ADD CONSTRAINT hr_departure_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_address_home_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_address_home_id_fkey FOREIGN KEY (address_home_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_address_id_fkey FOREIGN KEY (address_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_bank_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_bank_account_id_fkey FOREIGN KEY (bank_account_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: hr_employee_category hr_employee_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_category
    ADD CONSTRAINT hr_employee_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_employee_category hr_employee_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_category
    ADD CONSTRAINT hr_employee_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_coach_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_coach_id_fkey FOREIGN KEY (coach_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_contract_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_contract_id_fkey FOREIGN KEY (contract_id) REFERENCES public.hr_contract(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_country_of_birth_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_country_of_birth_fkey FOREIGN KEY (country_of_birth) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_departure_reason_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_departure_reason_id_fkey FOREIGN KEY (departure_reason_id) REFERENCES public.hr_departure_reason(id) ON DELETE RESTRICT;


--
-- Name: hr_employee hr_employee_expense_manager_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_expense_manager_id_fkey FOREIGN KEY (expense_manager_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_employee_hr_plan_wizard_rel hr_employee_hr_plan_wizard_rel_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_plan_wizard_rel
    ADD CONSTRAINT hr_employee_hr_plan_wizard_rel_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_plan_wizard(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_plan_wizard_rel hr_employee_hr_plan_wizard_rel_plan_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_plan_wizard_rel
    ADD CONSTRAINT hr_employee_hr_plan_wizard_rel_plan_wizard_id_fkey FOREIGN KEY (plan_wizard_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee hr_employee_job_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_job_id_fkey FOREIGN KEY (job_id) REFERENCES public.hr_job(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_resource_calendar_id_fkey FOREIGN KEY (resource_calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE RESTRICT;


--
-- Name: hr_employee hr_employee_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_work_contact_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_work_contact_id_fkey FOREIGN KEY (work_contact_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_work_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_work_location_id_fkey FOREIGN KEY (work_location_id) REFERENCES public.hr_work_location(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense hr_expense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: hr_expense_approve_duplicate_hr_expense_sheet_rel hr_expense_approve_duplicate__hr_expense_approve_duplicate_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_approve_duplicate_hr_expense_sheet_rel
    ADD CONSTRAINT hr_expense_approve_duplicate__hr_expense_approve_duplicate_fkey FOREIGN KEY (hr_expense_approve_duplicate_id) REFERENCES public.hr_expense_approve_duplicate(id) ON DELETE CASCADE;


--
-- Name: hr_expense_approve_duplicate hr_expense_approve_duplicate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_approve_duplicate
    ADD CONSTRAINT hr_expense_approve_duplicate_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_approve_duplicate_hr_expense_sheet_rel hr_expense_approve_duplicate_hr_expens_hr_expense_sheet_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_approve_duplicate_hr_expense_sheet_rel
    ADD CONSTRAINT hr_expense_approve_duplicate_hr_expens_hr_expense_sheet_id_fkey FOREIGN KEY (hr_expense_sheet_id) REFERENCES public.hr_expense_sheet(id) ON DELETE CASCADE;


--
-- Name: hr_expense_approve_duplicate hr_expense_approve_duplicate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_approve_duplicate
    ADD CONSTRAINT hr_expense_approve_duplicate_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense hr_expense_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: hr_expense hr_expense_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense hr_expense_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: hr_expense hr_expense_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE RESTRICT;


--
-- Name: hr_expense_hr_expense_approve_duplicate_rel hr_expense_hr_expense_approve_duplicate_rel_hr_expense_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_hr_expense_approve_duplicate_rel
    ADD CONSTRAINT hr_expense_hr_expense_approve_duplicate_rel_hr_expense_id_fkey FOREIGN KEY (hr_expense_id) REFERENCES public.hr_expense(id) ON DELETE CASCADE;


--
-- Name: hr_expense_hr_expense_approve_duplicate_rel hr_expense_hr_expense_approve_hr_expense_approve_duplicate_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_hr_expense_approve_duplicate_rel
    ADD CONSTRAINT hr_expense_hr_expense_approve_hr_expense_approve_duplicate_fkey FOREIGN KEY (hr_expense_approve_duplicate_id) REFERENCES public.hr_expense_approve_duplicate(id) ON DELETE CASCADE;


--
-- Name: hr_expense_hr_expense_refuse_wizard_rel hr_expense_hr_expense_refuse_w_hr_expense_refuse_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_hr_expense_refuse_wizard_rel
    ADD CONSTRAINT hr_expense_hr_expense_refuse_w_hr_expense_refuse_wizard_id_fkey FOREIGN KEY (hr_expense_refuse_wizard_id) REFERENCES public.hr_expense_refuse_wizard(id) ON DELETE CASCADE;


--
-- Name: hr_expense_hr_expense_refuse_wizard_rel hr_expense_hr_expense_refuse_wizard_rel_hr_expense_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_hr_expense_refuse_wizard_rel
    ADD CONSTRAINT hr_expense_hr_expense_refuse_wizard_rel_hr_expense_id_fkey FOREIGN KEY (hr_expense_id) REFERENCES public.hr_expense(id) ON DELETE CASCADE;


--
-- Name: hr_expense hr_expense_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: hr_expense hr_expense_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: hr_expense hr_expense_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: hr_expense_refuse_wizard hr_expense_refuse_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_refuse_wizard
    ADD CONSTRAINT hr_expense_refuse_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_refuse_wizard hr_expense_refuse_wizard_hr_expense_sheet_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_refuse_wizard
    ADD CONSTRAINT hr_expense_refuse_wizard_hr_expense_sheet_id_fkey FOREIGN KEY (hr_expense_sheet_id) REFERENCES public.hr_expense_sheet(id) ON DELETE SET NULL;


--
-- Name: hr_expense_refuse_wizard hr_expense_refuse_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_refuse_wizard
    ADD CONSTRAINT hr_expense_refuse_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense hr_expense_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE RESTRICT;


--
-- Name: hr_expense_sheet hr_expense_sheet_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_address_id_fkey FOREIGN KEY (address_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_bank_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_bank_journal_id_fkey FOREIGN KEY (bank_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: hr_expense_sheet hr_expense_sheet_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE RESTRICT;


--
-- Name: hr_expense hr_expense_sheet_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_sheet_id_fkey FOREIGN KEY (sheet_id) REFERENCES public.hr_expense_sheet(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_sheet hr_expense_sheet_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_sheet
    ADD CONSTRAINT hr_expense_sheet_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split hr_expense_split_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split hr_expense_split_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split hr_expense_split_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split hr_expense_split_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_expense_split hr_expense_split_expense_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_expense_id_fkey FOREIGN KEY (expense_id) REFERENCES public.hr_expense(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split hr_expense_split_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: hr_expense_split hr_expense_split_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split_wizard hr_expense_split_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split_wizard
    ADD CONSTRAINT hr_expense_split_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split_wizard hr_expense_split_wizard_expense_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split_wizard
    ADD CONSTRAINT hr_expense_split_wizard_expense_id_fkey FOREIGN KEY (expense_id) REFERENCES public.hr_expense(id) ON DELETE CASCADE;


--
-- Name: hr_expense_split hr_expense_split_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.hr_expense_split_wizard(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split_wizard hr_expense_split_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split_wizard
    ADD CONSTRAINT hr_expense_split_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense_split hr_expense_split_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense_split
    ADD CONSTRAINT hr_expense_split_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_expense hr_expense_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_expense
    ADD CONSTRAINT hr_expense_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_contract_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_contract_type_id_fkey FOREIGN KEY (contract_type_id) REFERENCES public.hr_contract_type(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_payroll_structure_type hr_payroll_structure_type_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_payroll_structure_type
    ADD CONSTRAINT hr_payroll_structure_type_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: hr_payroll_structure_type hr_payroll_structure_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_payroll_structure_type
    ADD CONSTRAINT hr_payroll_structure_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_payroll_structure_type hr_payroll_structure_type_default_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_payroll_structure_type
    ADD CONSTRAINT hr_payroll_structure_type_default_resource_calendar_id_fkey FOREIGN KEY (default_resource_calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: hr_payroll_structure_type hr_payroll_structure_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_payroll_structure_type
    ADD CONSTRAINT hr_payroll_structure_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_plan_activity_type hr_plan_activity_type_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_activity_type
    ADD CONSTRAINT hr_plan_activity_type_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: hr_plan_activity_type hr_plan_activity_type_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_activity_type
    ADD CONSTRAINT hr_plan_activity_type_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: hr_plan_activity_type hr_plan_activity_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_activity_type
    ADD CONSTRAINT hr_plan_activity_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_plan_activity_type hr_plan_activity_type_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_activity_type
    ADD CONSTRAINT hr_plan_activity_type_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.hr_plan(id) ON DELETE SET NULL;


--
-- Name: hr_plan_activity_type hr_plan_activity_type_responsible_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_activity_type
    ADD CONSTRAINT hr_plan_activity_type_responsible_id_fkey FOREIGN KEY (responsible_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_plan_activity_type hr_plan_activity_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_activity_type
    ADD CONSTRAINT hr_plan_activity_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_plan hr_plan_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan
    ADD CONSTRAINT hr_plan_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: hr_plan hr_plan_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan
    ADD CONSTRAINT hr_plan_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_plan hr_plan_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan
    ADD CONSTRAINT hr_plan_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_plan_wizard hr_plan_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_wizard
    ADD CONSTRAINT hr_plan_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_plan_wizard hr_plan_wizard_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_wizard
    ADD CONSTRAINT hr_plan_wizard_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.hr_plan(id) ON DELETE SET NULL;


--
-- Name: hr_plan_wizard hr_plan_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan_wizard
    ADD CONSTRAINT hr_plan_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_plan hr_plan_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_plan
    ADD CONSTRAINT hr_plan_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_work_location hr_work_location_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_work_location
    ADD CONSTRAINT hr_work_location_address_id_fkey FOREIGN KEY (address_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: hr_work_location hr_work_location_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_work_location
    ADD CONSTRAINT hr_work_location_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: hr_work_location hr_work_location_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_work_location
    ADD CONSTRAINT hr_work_location_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: hr_work_location hr_work_location_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_work_location
    ADD CONSTRAINT hr_work_location_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: iap_account iap_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.iap_account
    ADD CONSTRAINT iap_account_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: iap_account_res_company_rel iap_account_res_company_rel_iap_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.iap_account_res_company_rel
    ADD CONSTRAINT iap_account_res_company_rel_iap_account_id_fkey FOREIGN KEY (iap_account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: iap_account_res_company_rel iap_account_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.iap_account_res_company_rel
    ADD CONSTRAINT iap_account_res_company_rel_res_company_id_fkey FOREIGN KEY (res_company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: iap_account iap_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.iap_account
    ADD CONSTRAINT iap_account_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: im_livechat_channel_country_rel im_livechat_channel_country_rel_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_country_rel
    ADD CONSTRAINT im_livechat_channel_country_rel_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.im_livechat_channel_rule(id) ON DELETE CASCADE;


--
-- Name: im_livechat_channel_country_rel im_livechat_channel_country_rel_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_country_rel
    ADD CONSTRAINT im_livechat_channel_country_rel_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: im_livechat_channel im_livechat_channel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel
    ADD CONSTRAINT im_livechat_channel_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: im_livechat_channel_im_user im_livechat_channel_im_user_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_im_user
    ADD CONSTRAINT im_livechat_channel_im_user_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.im_livechat_channel(id) ON DELETE CASCADE;


--
-- Name: im_livechat_channel_im_user im_livechat_channel_im_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_im_user
    ADD CONSTRAINT im_livechat_channel_im_user_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: im_livechat_channel_rule im_livechat_channel_rule_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_rule
    ADD CONSTRAINT im_livechat_channel_rule_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.im_livechat_channel(id) ON DELETE SET NULL;


--
-- Name: im_livechat_channel_rule im_livechat_channel_rule_chatbot_script_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_rule
    ADD CONSTRAINT im_livechat_channel_rule_chatbot_script_id_fkey FOREIGN KEY (chatbot_script_id) REFERENCES public.chatbot_script(id) ON DELETE SET NULL;


--
-- Name: im_livechat_channel_rule im_livechat_channel_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_rule
    ADD CONSTRAINT im_livechat_channel_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: im_livechat_channel_rule im_livechat_channel_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel_rule
    ADD CONSTRAINT im_livechat_channel_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: im_livechat_channel im_livechat_channel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.im_livechat_channel
    ADD CONSTRAINT im_livechat_channel_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_client ir_act_client_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_client
    ADD CONSTRAINT ir_act_client_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_client ir_act_client_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_client
    ADD CONSTRAINT ir_act_client_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_client ir_act_client_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_client
    ADD CONSTRAINT ir_act_client_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_report_xml ir_act_report_xml_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_report_xml ir_act_report_xml_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_report_xml ir_act_report_xml_paperformat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_paperformat_id_fkey FOREIGN KEY (paperformat_id) REFERENCES public.report_paperformat(id) ON DELETE SET NULL;


--
-- Name: ir_act_report_xml ir_act_report_xml_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: ir_act_server ir_act_server_activity_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_activity_user_id_fkey FOREIGN KEY (activity_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_crud_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_crud_model_id_fkey FOREIGN KEY (crud_model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: ir_act_server_group_rel ir_act_server_group_rel_act_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server_group_rel
    ADD CONSTRAINT ir_act_server_group_rel_act_id_fkey FOREIGN KEY (act_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: ir_act_server_group_rel ir_act_server_group_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server_group_rel
    ADD CONSTRAINT ir_act_server_group_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_link_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_link_field_id_fkey FOREIGN KEY (link_field_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_server_res_partner_rel ir_act_server_res_partner_rel_ir_act_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server_res_partner_rel
    ADD CONSTRAINT ir_act_server_res_partner_rel_ir_act_server_id_fkey FOREIGN KEY (ir_act_server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: ir_act_server_res_partner_rel ir_act_server_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server_res_partner_rel
    ADD CONSTRAINT ir_act_server_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_url ir_act_url_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_url
    ADD CONSTRAINT ir_act_url_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_url ir_act_url_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_url
    ADD CONSTRAINT ir_act_url_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_url ir_act_url_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_url
    ADD CONSTRAINT ir_act_url_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window ir_act_window_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_window ir_act_window_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_group_rel ir_act_window_group_rel_act_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window_group_rel
    ADD CONSTRAINT ir_act_window_group_rel_act_id_fkey FOREIGN KEY (act_id) REFERENCES public.ir_act_window(id) ON DELETE CASCADE;


--
-- Name: ir_act_window_group_rel ir_act_window_group_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window_group_rel
    ADD CONSTRAINT ir_act_window_group_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_act_window ir_act_window_search_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_search_view_id_fkey FOREIGN KEY (search_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_view ir_act_window_view_act_window_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_act_window_id_fkey FOREIGN KEY (act_window_id) REFERENCES public.ir_act_window(id) ON DELETE CASCADE;


--
-- Name: ir_act_window_view ir_act_window_view_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window ir_act_window_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_view ir_act_window_view_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_view ir_act_window_view_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window ir_act_window_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions ir_actions_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_actions
    ADD CONSTRAINT ir_actions_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_actions ir_actions_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_actions
    ADD CONSTRAINT ir_actions_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions_todo ir_actions_todo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_actions_todo
    ADD CONSTRAINT ir_actions_todo_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions_todo ir_actions_todo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_actions_todo
    ADD CONSTRAINT ir_actions_todo_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions ir_actions_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_actions
    ADD CONSTRAINT ir_actions_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_asset ir_asset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_asset ir_asset_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_ir_asset(id) ON DELETE SET NULL;


--
-- Name: ir_asset ir_asset_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: ir_asset ir_asset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_original_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_original_id_fkey FOREIGN KEY (original_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_ir_attachment(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_config_parameter ir_config_parameter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_config_parameter
    ADD CONSTRAINT ir_config_parameter_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_config_parameter ir_config_parameter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_config_parameter
    ADD CONSTRAINT ir_config_parameter_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron ir_cron_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron ir_cron_ir_actions_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_ir_actions_server_id_fkey FOREIGN KEY (ir_actions_server_id) REFERENCES public.ir_act_server(id) ON DELETE RESTRICT;


--
-- Name: ir_cron_trigger ir_cron_trigger_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron_trigger
    ADD CONSTRAINT ir_cron_trigger_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron_trigger ir_cron_trigger_cron_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron_trigger
    ADD CONSTRAINT ir_cron_trigger_cron_id_fkey FOREIGN KEY (cron_id) REFERENCES public.ir_cron(id) ON DELETE SET NULL;


--
-- Name: ir_cron_trigger ir_cron_trigger_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron_trigger
    ADD CONSTRAINT ir_cron_trigger_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron ir_cron_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: ir_cron ir_cron_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_default ir_default_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: ir_default ir_default_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_default ir_default_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_default ir_default_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: ir_default ir_default_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo ir_demo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo
    ADD CONSTRAINT ir_demo_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_demo_failure_wizard ir_demo_failure_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo_failure_wizard
    ADD CONSTRAINT ir_demo_failure_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.ir_demo_failure_wizard(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure_wizard ir_demo_failure_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo_failure_wizard
    ADD CONSTRAINT ir_demo_failure_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo ir_demo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_demo
    ADD CONSTRAINT ir_demo_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports ir_exports_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_exports
    ADD CONSTRAINT ir_exports_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports_line ir_exports_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_exports_line
    ADD CONSTRAINT ir_exports_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports_line ir_exports_line_export_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_exports_line
    ADD CONSTRAINT ir_exports_line_export_id_fkey FOREIGN KEY (export_id) REFERENCES public.ir_exports(id) ON DELETE CASCADE;


--
-- Name: ir_exports_line ir_exports_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_exports_line
    ADD CONSTRAINT ir_exports_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports ir_exports_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_exports
    ADD CONSTRAINT ir_exports_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_filters ir_filters_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_filters
    ADD CONSTRAINT ir_filters_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_filters ir_filters_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_filters
    ADD CONSTRAINT ir_filters_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: ir_filters ir_filters_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_filters
    ADD CONSTRAINT ir_filters_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_mail_server ir_mail_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_mail_server
    ADD CONSTRAINT ir_mail_server_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_mail_server ir_mail_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_mail_server
    ADD CONSTRAINT ir_mail_server_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_access ir_model_access_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_access ir_model_access_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE RESTRICT;


--
-- Name: ir_model_access ir_model_access_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_access ir_model_access_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_constraint ir_model_constraint_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_constraint ir_model_constraint_model_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_model_fkey FOREIGN KEY (model) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_constraint ir_model_constraint_module_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_module_fkey FOREIGN KEY (module) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_model_constraint ir_model_constraint_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model ir_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model
    ADD CONSTRAINT ir_model_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_data ir_model_data_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_data
    ADD CONSTRAINT ir_model_data_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_data ir_model_data_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_data
    ADD CONSTRAINT ir_model_data_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields ir_model_fields_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields_group_rel ir_model_fields_group_rel_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields_group_rel
    ADD CONSTRAINT ir_model_fields_group_rel_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields_group_rel ir_model_fields_group_rel_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields_group_rel
    ADD CONSTRAINT ir_model_fields_group_rel_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields ir_model_fields_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields ir_model_fields_related_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_related_field_id_fkey FOREIGN KEY (related_field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields ir_model_fields_relation_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_relation_field_id_fkey FOREIGN KEY (relation_field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields_selection ir_model_fields_selection_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields_selection
    ADD CONSTRAINT ir_model_fields_selection_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields_selection ir_model_fields_selection_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields_selection
    ADD CONSTRAINT ir_model_fields_selection_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields_selection ir_model_fields_selection_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields_selection
    ADD CONSTRAINT ir_model_fields_selection_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields ir_model_fields_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_relation ir_model_relation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_relation ir_model_relation_model_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_model_fkey FOREIGN KEY (model) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_relation ir_model_relation_module_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_module_fkey FOREIGN KEY (module) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_model_relation ir_model_relation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model ir_model_website_form_default_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model
    ADD CONSTRAINT ir_model_website_form_default_field_id_fkey FOREIGN KEY (website_form_default_field_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: ir_model ir_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_model
    ADD CONSTRAINT ir_model_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_category ir_module_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_category
    ADD CONSTRAINT ir_module_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_category ir_module_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_category
    ADD CONSTRAINT ir_module_category_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.ir_module_category(id) ON DELETE SET NULL;


--
-- Name: ir_module_category ir_module_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_category
    ADD CONSTRAINT ir_module_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module ir_module_module_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_module
    ADD CONSTRAINT ir_module_module_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.ir_module_category(id) ON DELETE SET NULL;


--
-- Name: ir_module_module ir_module_module_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_module
    ADD CONSTRAINT ir_module_module_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module_dependency ir_module_module_dependency_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_module_dependency
    ADD CONSTRAINT ir_module_module_dependency_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_module_module_exclusion ir_module_module_exclusion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_module_exclusion
    ADD CONSTRAINT ir_module_module_exclusion_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module_exclusion ir_module_module_exclusion_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_module_exclusion
    ADD CONSTRAINT ir_module_module_exclusion_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_module_module_exclusion ir_module_module_exclusion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_module_exclusion
    ADD CONSTRAINT ir_module_module_exclusion_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module ir_module_module_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_module_module
    ADD CONSTRAINT ir_module_module_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_property ir_property_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_property
    ADD CONSTRAINT ir_property_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: ir_property ir_property_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_property
    ADD CONSTRAINT ir_property_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_property ir_property_fields_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_property
    ADD CONSTRAINT ir_property_fields_id_fkey FOREIGN KEY (fields_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_property ir_property_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_property
    ADD CONSTRAINT ir_property_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_rule ir_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_rule
    ADD CONSTRAINT ir_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_rule ir_rule_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_rule
    ADD CONSTRAINT ir_rule_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_rule ir_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_rule
    ADD CONSTRAINT ir_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence ir_sequence_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_sequence
    ADD CONSTRAINT ir_sequence_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: ir_sequence ir_sequence_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_sequence
    ADD CONSTRAINT ir_sequence_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence_date_range ir_sequence_date_range_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_sequence_date_range
    ADD CONSTRAINT ir_sequence_date_range_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence_date_range ir_sequence_date_range_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_sequence_date_range
    ADD CONSTRAINT ir_sequence_date_range_sequence_id_fkey FOREIGN KEY (sequence_id) REFERENCES public.ir_sequence(id) ON DELETE CASCADE;


--
-- Name: ir_sequence_date_range ir_sequence_date_range_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_sequence_date_range
    ADD CONSTRAINT ir_sequence_date_range_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence ir_sequence_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_sequence
    ADD CONSTRAINT ir_sequence_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_server_object_lines ir_server_object_lines_col1_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_server_object_lines
    ADD CONSTRAINT ir_server_object_lines_col1_fkey FOREIGN KEY (col1) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_server_object_lines ir_server_object_lines_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_server_object_lines
    ADD CONSTRAINT ir_server_object_lines_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_server_object_lines ir_server_object_lines_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_server_object_lines
    ADD CONSTRAINT ir_server_object_lines_server_id_fkey FOREIGN KEY (server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: ir_server_object_lines ir_server_object_lines_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_server_object_lines
    ADD CONSTRAINT ir_server_object_lines_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_menu ir_ui_menu_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_menu
    ADD CONSTRAINT ir_ui_menu_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_menu_group_rel ir_ui_menu_group_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_menu_group_rel
    ADD CONSTRAINT ir_ui_menu_group_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_ui_menu_group_rel ir_ui_menu_group_rel_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_menu_group_rel
    ADD CONSTRAINT ir_ui_menu_group_rel_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.ir_ui_menu(id) ON DELETE CASCADE;


--
-- Name: ir_ui_menu ir_ui_menu_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_menu
    ADD CONSTRAINT ir_ui_menu_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.ir_ui_menu(id) ON DELETE RESTRICT;


--
-- Name: ir_ui_menu ir_ui_menu_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_menu
    ADD CONSTRAINT ir_ui_menu_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view ir_ui_view_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_ref_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_ref_id_fkey FOREIGN KEY (ref_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view_group_rel ir_ui_view_group_rel_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view_group_rel
    ADD CONSTRAINT ir_ui_view_group_rel_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view_group_rel ir_ui_view_group_rel_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view_group_rel
    ADD CONSTRAINT ir_ui_view_group_rel_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view ir_ui_view_inherit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_inherit_id_fkey FOREIGN KEY (inherit_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: ir_ui_view ir_ui_view_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view ir_ui_view_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view ir_ui_view_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: journal_account_control_rel journal_account_control_rel_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.journal_account_control_rel
    ADD CONSTRAINT journal_account_control_rel_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: journal_account_control_rel journal_account_control_rel_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.journal_account_control_rel
    ADD CONSTRAINT journal_account_control_rel_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: link_tracker link_tracker_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_link_id_fkey FOREIGN KEY (link_id) REFERENCES public.link_tracker(id) ON DELETE CASCADE;


--
-- Name: link_tracker_click link_tracker_click_mailing_trace_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_mailing_trace_id_fkey FOREIGN KEY (mailing_trace_id) REFERENCES public.mailing_trace(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_mass_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_mass_mailing_id_fkey FOREIGN KEY (mass_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: link_tracker_code link_tracker_code_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_code
    ADD CONSTRAINT link_tracker_code_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: link_tracker_code link_tracker_code_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_code
    ADD CONSTRAINT link_tracker_code_link_id_fkey FOREIGN KEY (link_id) REFERENCES public.link_tracker(id) ON DELETE CASCADE;


--
-- Name: link_tracker_code link_tracker_code_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_code
    ADD CONSTRAINT link_tracker_code_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: link_tracker link_tracker_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: link_tracker link_tracker_mass_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_mass_mailing_id_fkey FOREIGN KEY (mass_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE SET NULL;


--
-- Name: link_tracker link_tracker_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: link_tracker link_tracker_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: link_tracker link_tracker_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: lot_label_layout lot_label_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.lot_label_layout
    ADD CONSTRAINT lot_label_layout_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: lot_label_layout_stock_picking_rel lot_label_layout_stock_picking_rel_lot_label_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.lot_label_layout_stock_picking_rel
    ADD CONSTRAINT lot_label_layout_stock_picking_rel_lot_label_layout_id_fkey FOREIGN KEY (lot_label_layout_id) REFERENCES public.lot_label_layout(id) ON DELETE CASCADE;


--
-- Name: lot_label_layout_stock_picking_rel lot_label_layout_stock_picking_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.lot_label_layout_stock_picking_rel
    ADD CONSTRAINT lot_label_layout_stock_picking_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: lot_label_layout lot_label_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.lot_label_layout
    ADD CONSTRAINT lot_label_layout_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: mail_activity mail_activity_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_calendar_event_id_fkey FOREIGN KEY (calendar_event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: mail_activity mail_activity_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_note_id_fkey FOREIGN KEY (note_id) REFERENCES public.note_note(id) ON DELETE CASCADE;


--
-- Name: mail_activity mail_activity_previous_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_previous_activity_type_id_fkey FOREIGN KEY (previous_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_recommended_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_recommended_activity_type_id_fkey FOREIGN KEY (recommended_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_activity_rel mail_activity_rel_activity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_rel
    ADD CONSTRAINT mail_activity_rel_activity_id_fkey FOREIGN KEY (activity_id) REFERENCES public.mail_activity_type(id) ON DELETE CASCADE;


--
-- Name: mail_activity_rel mail_activity_rel_recommended_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_rel
    ADD CONSTRAINT mail_activity_rel_recommended_id_fkey FOREIGN KEY (recommended_id) REFERENCES public.mail_activity_type(id) ON DELETE CASCADE;


--
-- Name: mail_activity mail_activity_request_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_request_partner_id_fkey FOREIGN KEY (request_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mail_activity_type mail_activity_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_type mail_activity_type_default_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_default_user_id_fkey FOREIGN KEY (default_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_type_mail_template_rel mail_activity_type_mail_template_rel_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_type_mail_template_rel
    ADD CONSTRAINT mail_activity_type_mail_template_rel_mail_activity_type_id_fkey FOREIGN KEY (mail_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE CASCADE;


--
-- Name: mail_activity_type_mail_template_rel mail_activity_type_mail_template_rel_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_type_mail_template_rel
    ADD CONSTRAINT mail_activity_type_mail_template_rel_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: mail_activity_type mail_activity_type_triggered_next_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_triggered_next_type_id_fkey FOREIGN KEY (triggered_next_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: mail_activity_type mail_activity_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: mail_activity mail_activity_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_alias mail_alias_alias_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_alias_model_id_fkey FOREIGN KEY (alias_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mail_alias mail_alias_alias_parent_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_alias_parent_model_id_fkey FOREIGN KEY (alias_parent_model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: mail_alias mail_alias_alias_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_alias_user_id_fkey FOREIGN KEY (alias_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_alias mail_alias_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_alias mail_alias_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist mail_blacklist_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_blacklist
    ADD CONSTRAINT mail_blacklist_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist mail_blacklist_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_blacklist
    ADD CONSTRAINT mail_blacklist_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist_remove mail_blacklist_remove_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_blacklist_remove
    ADD CONSTRAINT mail_blacklist_remove_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist_remove mail_blacklist_remove_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_blacklist_remove
    ADD CONSTRAINT mail_blacklist_remove_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist mail_blacklist_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_blacklist
    ADD CONSTRAINT mail_blacklist_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_chatbot_current_step_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_chatbot_current_step_id_fkey FOREIGN KEY (chatbot_current_step_id) REFERENCES public.chatbot_script_step(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_group_public_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_group_public_id_fkey FOREIGN KEY (group_public_id) REFERENCES public.res_groups(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_livechat_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_livechat_channel_id_fkey FOREIGN KEY (livechat_channel_id) REFERENCES public.im_livechat_channel(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_livechat_operator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_livechat_operator_id_fkey FOREIGN KEY (livechat_operator_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_livechat_visitor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_livechat_visitor_id_fkey FOREIGN KEY (livechat_visitor_id) REFERENCES public.website_visitor(id) ON DELETE SET NULL;


--
-- Name: mail_channel_member mail_channel_member_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.mail_channel(id) ON DELETE CASCADE;


--
-- Name: mail_channel_member mail_channel_member_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_channel_member mail_channel_member_fetched_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_fetched_message_id_fkey FOREIGN KEY (fetched_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_channel_member mail_channel_member_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.mail_guest(id) ON DELETE CASCADE;


--
-- Name: mail_channel_member mail_channel_member_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_channel_member mail_channel_member_rtc_inviting_session_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_rtc_inviting_session_id_fkey FOREIGN KEY (rtc_inviting_session_id) REFERENCES public.mail_channel_rtc_session(id) ON DELETE SET NULL;


--
-- Name: mail_channel_member mail_channel_member_seen_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_seen_message_id_fkey FOREIGN KEY (seen_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_channel_member mail_channel_member_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_member
    ADD CONSTRAINT mail_channel_member_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: mail_channel_res_groups_rel mail_channel_res_groups_rel_mail_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_res_groups_rel
    ADD CONSTRAINT mail_channel_res_groups_rel_mail_channel_id_fkey FOREIGN KEY (mail_channel_id) REFERENCES public.mail_channel(id) ON DELETE CASCADE;


--
-- Name: mail_channel_res_groups_rel mail_channel_res_groups_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_res_groups_rel
    ADD CONSTRAINT mail_channel_res_groups_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: mail_channel_rtc_session mail_channel_rtc_session_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_rtc_session
    ADD CONSTRAINT mail_channel_rtc_session_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.mail_channel(id) ON DELETE SET NULL;


--
-- Name: mail_channel_rtc_session mail_channel_rtc_session_channel_member_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_rtc_session
    ADD CONSTRAINT mail_channel_rtc_session_channel_member_id_fkey FOREIGN KEY (channel_member_id) REFERENCES public.mail_channel_member(id) ON DELETE CASCADE;


--
-- Name: mail_channel_rtc_session mail_channel_rtc_session_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_rtc_session
    ADD CONSTRAINT mail_channel_rtc_session_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_channel_rtc_session mail_channel_rtc_session_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel_rtc_session
    ADD CONSTRAINT mail_channel_rtc_session_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_channel mail_channel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_channel
    ADD CONSTRAINT mail_channel_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message_ir_attachments_rel mail_compose_message_ir_attachments_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message_ir_attachments_rel
    ADD CONSTRAINT mail_compose_message_ir_attachments_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message_ir_attachments_rel mail_compose_message_ir_attachments_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message_ir_attachments_rel
    ADD CONSTRAINT mail_compose_message_ir_attachments_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.mail_compose_message(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message mail_compose_message_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_mail_activity_type_id_fkey FOREIGN KEY (mail_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message_mailing_list_rel mail_compose_message_mailing_list__mail_compose_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message_mailing_list_rel
    ADD CONSTRAINT mail_compose_message_mailing_list__mail_compose_message_id_fkey FOREIGN KEY (mail_compose_message_id) REFERENCES public.mail_compose_message(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message_mailing_list_rel mail_compose_message_mailing_list_rel_mailing_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message_mailing_list_rel
    ADD CONSTRAINT mail_compose_message_mailing_list_rel_mailing_list_id_fkey FOREIGN KEY (mailing_list_id) REFERENCES public.mailing_list(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message mail_compose_message_mass_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_mass_mailing_id_fkey FOREIGN KEY (mass_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message mail_compose_message_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message_res_partner_rel mail_compose_message_res_partner_rel_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message_res_partner_rel
    ADD CONSTRAINT mail_compose_message_res_partner_rel_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message_res_partner_rel mail_compose_message_res_partner_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message_res_partner_rel
    ADD CONSTRAINT mail_compose_message_res_partner_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.mail_compose_message(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message mail_compose_message_subtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_subtype_id_fkey FOREIGN KEY (subtype_id) REFERENCES public.mail_message_subtype(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_followers_mail_message_subtype_rel mail_followers_mail_message_subtyp_mail_message_subtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_followers_mail_message_subtype_rel
    ADD CONSTRAINT mail_followers_mail_message_subtyp_mail_message_subtype_id_fkey FOREIGN KEY (mail_message_subtype_id) REFERENCES public.mail_message_subtype(id) ON DELETE CASCADE;


--
-- Name: mail_followers_mail_message_subtype_rel mail_followers_mail_message_subtype_rel_mail_followers_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_followers_mail_message_subtype_rel
    ADD CONSTRAINT mail_followers_mail_message_subtype_rel_mail_followers_id_fkey FOREIGN KEY (mail_followers_id) REFERENCES public.mail_followers(id) ON DELETE CASCADE;


--
-- Name: mail_followers mail_followers_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_followers
    ADD CONSTRAINT mail_followers_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_gateway_allowed mail_gateway_allowed_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_gateway_allowed
    ADD CONSTRAINT mail_gateway_allowed_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_gateway_allowed mail_gateway_allowed_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_gateway_allowed
    ADD CONSTRAINT mail_gateway_allowed_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_guest mail_guest_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_guest
    ADD CONSTRAINT mail_guest_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: mail_guest mail_guest_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_guest
    ADD CONSTRAINT mail_guest_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_guest mail_guest_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_guest
    ADD CONSTRAINT mail_guest_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_ice_server mail_ice_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_ice_server
    ADD CONSTRAINT mail_ice_server_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_ice_server mail_ice_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_ice_server
    ADD CONSTRAINT mail_ice_server_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_link_preview mail_link_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_link_preview
    ADD CONSTRAINT mail_link_preview_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_link_preview mail_link_preview_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_link_preview
    ADD CONSTRAINT mail_link_preview_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_link_preview mail_link_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_link_preview
    ADD CONSTRAINT mail_link_preview_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_mail mail_mail_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_mail mail_mail_fetchmail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_fetchmail_server_id_fkey FOREIGN KEY (fetchmail_server_id) REFERENCES public.fetchmail_server(id) ON DELETE SET NULL;


--
-- Name: mail_mail mail_mail_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_mail mail_mail_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_mailing_id_fkey FOREIGN KEY (mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE SET NULL;


--
-- Name: mail_mail_res_partner_rel mail_mail_res_partner_rel_mail_mail_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mail_res_partner_rel
    ADD CONSTRAINT mail_mail_res_partner_rel_mail_mail_id_fkey FOREIGN KEY (mail_mail_id) REFERENCES public.mail_mail(id) ON DELETE CASCADE;


--
-- Name: mail_mail_res_partner_rel mail_mail_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mail_res_partner_rel
    ADD CONSTRAINT mail_mail_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_mail mail_mail_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_mass_mailing_list_rel mail_mass_mailing_list_rel_mailing_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mass_mailing_list_rel
    ADD CONSTRAINT mail_mass_mailing_list_rel_mailing_list_id_fkey FOREIGN KEY (mailing_list_id) REFERENCES public.mailing_list(id) ON DELETE CASCADE;


--
-- Name: mail_mass_mailing_list_rel mail_mass_mailing_list_rel_mailing_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_mass_mailing_list_rel
    ADD CONSTRAINT mail_mass_mailing_list_rel_mailing_mailing_id_fkey FOREIGN KEY (mailing_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE CASCADE;


--
-- Name: mail_message mail_message_author_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_author_guest_id_fkey FOREIGN KEY (author_guest_id) REFERENCES public.mail_guest(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_mail_activity_type_id_fkey FOREIGN KEY (mail_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_message_reaction mail_message_reaction_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_reaction
    ADD CONSTRAINT mail_message_reaction_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.mail_guest(id) ON DELETE CASCADE;


--
-- Name: mail_message_reaction mail_message_reaction_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_reaction
    ADD CONSTRAINT mail_message_reaction_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_reaction mail_message_reaction_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_reaction
    ADD CONSTRAINT mail_message_reaction_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_message_res_partner_rel mail_message_res_partner_rel_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_res_partner_rel
    ADD CONSTRAINT mail_message_res_partner_rel_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_res_partner_rel mail_message_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_res_partner_rel
    ADD CONSTRAINT mail_message_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_message_res_partner_starred_rel mail_message_res_partner_starred_rel_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_res_partner_starred_rel
    ADD CONSTRAINT mail_message_res_partner_starred_rel_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_res_partner_starred_rel mail_message_res_partner_starred_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_res_partner_starred_rel
    ADD CONSTRAINT mail_message_res_partner_starred_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_message_schedule mail_message_schedule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_schedule
    ADD CONSTRAINT mail_message_schedule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_schedule mail_message_schedule_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_schedule
    ADD CONSTRAINT mail_message_schedule_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_schedule mail_message_schedule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_schedule
    ADD CONSTRAINT mail_message_schedule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_subtype mail_message_subtype_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_subtype
    ADD CONSTRAINT mail_message_subtype_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_subtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_subtype_id_fkey FOREIGN KEY (subtype_id) REFERENCES public.mail_message_subtype(id) ON DELETE SET NULL;


--
-- Name: mail_message_subtype mail_message_subtype_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_subtype
    ADD CONSTRAINT mail_message_subtype_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.mail_message_subtype(id) ON DELETE SET NULL;


--
-- Name: mail_message_subtype mail_message_subtype_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message_subtype
    ADD CONSTRAINT mail_message_subtype_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_notification mail_notification_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_notification mail_notification_letter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_letter_id_fkey FOREIGN KEY (letter_id) REFERENCES public.snailmail_letter(id) ON DELETE CASCADE;


--
-- Name: mail_notification mail_notification_mail_mail_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_mail_mail_id_fkey FOREIGN KEY (mail_mail_id) REFERENCES public.mail_mail(id) ON DELETE SET NULL;


--
-- Name: mail_notification mail_notification_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_notification_mail_resend_message_rel mail_notification_mail_resend_messa_mail_resend_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification_mail_resend_message_rel
    ADD CONSTRAINT mail_notification_mail_resend_messa_mail_resend_message_id_fkey FOREIGN KEY (mail_resend_message_id) REFERENCES public.mail_resend_message(id) ON DELETE CASCADE;


--
-- Name: mail_notification_mail_resend_message_rel mail_notification_mail_resend_message_mail_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification_mail_resend_message_rel
    ADD CONSTRAINT mail_notification_mail_resend_message_mail_notification_id_fkey FOREIGN KEY (mail_notification_id) REFERENCES public.mail_notification(id) ON DELETE CASCADE;


--
-- Name: mail_notification mail_notification_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_notification mail_notification_sms_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_sms_id_fkey FOREIGN KEY (sms_id) REFERENCES public.sms_sms(id) ON DELETE SET NULL;


--
-- Name: mail_resend_message mail_resend_message_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_message
    ADD CONSTRAINT mail_resend_message_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_resend_message mail_resend_message_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_message
    ADD CONSTRAINT mail_resend_message_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_resend_message mail_resend_message_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_message
    ADD CONSTRAINT mail_resend_message_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_resend_partner mail_resend_partner_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_partner
    ADD CONSTRAINT mail_resend_partner_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_resend_partner mail_resend_partner_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_partner
    ADD CONSTRAINT mail_resend_partner_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_resend_partner mail_resend_partner_resend_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_partner
    ADD CONSTRAINT mail_resend_partner_resend_wizard_id_fkey FOREIGN KEY (resend_wizard_id) REFERENCES public.mail_resend_message(id) ON DELETE SET NULL;


--
-- Name: mail_resend_partner mail_resend_partner_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_partner
    ADD CONSTRAINT mail_resend_partner_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_shortcode mail_shortcode_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_shortcode
    ADD CONSTRAINT mail_shortcode_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_shortcode mail_shortcode_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_shortcode
    ADD CONSTRAINT mail_shortcode_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: mail_template_mail_template_reset_rel mail_template_mail_template_reset_r_mail_template_reset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template_mail_template_reset_rel
    ADD CONSTRAINT mail_template_mail_template_reset_r_mail_template_reset_id_fkey FOREIGN KEY (mail_template_reset_id) REFERENCES public.mail_template_reset(id) ON DELETE CASCADE;


--
-- Name: mail_template_mail_template_reset_rel mail_template_mail_template_reset_rel_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template_mail_template_reset_rel
    ADD CONSTRAINT mail_template_mail_template_reset_rel_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: mail_template mail_template_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: mail_template_preview mail_template_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template_preview
    ADD CONSTRAINT mail_template_preview_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template_preview mail_template_preview_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template_preview
    ADD CONSTRAINT mail_template_preview_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: mail_template_preview mail_template_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template_preview
    ADD CONSTRAINT mail_template_preview_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_ref_ir_act_window_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_ref_ir_act_window_fkey FOREIGN KEY (ref_ir_act_window) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_report_template_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_report_template_fkey FOREIGN KEY (report_template) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: mail_template_reset mail_template_reset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template_reset
    ADD CONSTRAINT mail_template_reset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template_reset mail_template_reset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template_reset
    ADD CONSTRAINT mail_template_reset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_tracking_value mail_tracking_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_tracking_value mail_tracking_value_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: mail_tracking_value mail_tracking_value_field_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_field_fkey FOREIGN KEY (field) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: mail_tracking_value mail_tracking_value_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_tracking_value mail_tracking_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_wizard_invite mail_wizard_invite_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_wizard_invite
    ADD CONSTRAINT mail_wizard_invite_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_wizard_invite_res_partner_rel mail_wizard_invite_res_partner_rel_mail_wizard_invite_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_wizard_invite_res_partner_rel
    ADD CONSTRAINT mail_wizard_invite_res_partner_rel_mail_wizard_invite_id_fkey FOREIGN KEY (mail_wizard_invite_id) REFERENCES public.mail_wizard_invite(id) ON DELETE CASCADE;


--
-- Name: mail_wizard_invite_res_partner_rel mail_wizard_invite_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_wizard_invite_res_partner_rel
    ADD CONSTRAINT mail_wizard_invite_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_wizard_invite mail_wizard_invite_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_wizard_invite
    ADD CONSTRAINT mail_wizard_invite_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact mailing_contact_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact
    ADD CONSTRAINT mailing_contact_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: mailing_contact mailing_contact_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact
    ADD CONSTRAINT mailing_contact_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_import mailing_contact_import_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_import
    ADD CONSTRAINT mailing_contact_import_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_import_mailing_list_rel mailing_contact_import_mailing_l_mailing_contact_import_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_import_mailing_list_rel
    ADD CONSTRAINT mailing_contact_import_mailing_l_mailing_contact_import_id_fkey FOREIGN KEY (mailing_contact_import_id) REFERENCES public.mailing_contact_import(id) ON DELETE CASCADE;


--
-- Name: mailing_contact_import_mailing_list_rel mailing_contact_import_mailing_list_rel_mailing_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_import_mailing_list_rel
    ADD CONSTRAINT mailing_contact_import_mailing_list_rel_mailing_list_id_fkey FOREIGN KEY (mailing_list_id) REFERENCES public.mailing_list(id) ON DELETE CASCADE;


--
-- Name: mailing_contact_import mailing_contact_import_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_import
    ADD CONSTRAINT mailing_contact_import_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_list_rel mailing_contact_list_rel_contact_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_list_rel
    ADD CONSTRAINT mailing_contact_list_rel_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES public.mailing_contact(id) ON DELETE CASCADE;


--
-- Name: mailing_contact_list_rel mailing_contact_list_rel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_list_rel
    ADD CONSTRAINT mailing_contact_list_rel_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_list_rel mailing_contact_list_rel_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_list_rel
    ADD CONSTRAINT mailing_contact_list_rel_list_id_fkey FOREIGN KEY (list_id) REFERENCES public.mailing_list(id) ON DELETE CASCADE;


--
-- Name: mailing_contact_list_rel mailing_contact_list_rel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_list_rel
    ADD CONSTRAINT mailing_contact_list_rel_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_mailing_contact_to_list_rel mailing_contact_mailing_contact_mailing_contact_to_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_mailing_contact_to_list_rel
    ADD CONSTRAINT mailing_contact_mailing_contact_mailing_contact_to_list_id_fkey FOREIGN KEY (mailing_contact_to_list_id) REFERENCES public.mailing_contact_to_list(id) ON DELETE CASCADE;


--
-- Name: mailing_contact_mailing_contact_to_list_rel mailing_contact_mailing_contact_to_list_mailing_contact_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_mailing_contact_to_list_rel
    ADD CONSTRAINT mailing_contact_mailing_contact_to_list_mailing_contact_id_fkey FOREIGN KEY (mailing_contact_id) REFERENCES public.mailing_contact(id) ON DELETE CASCADE;


--
-- Name: mailing_contact mailing_contact_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact
    ADD CONSTRAINT mailing_contact_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_res_partner_category_rel mailing_contact_res_partner_catego_res_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_res_partner_category_rel
    ADD CONSTRAINT mailing_contact_res_partner_catego_res_partner_category_id_fkey FOREIGN KEY (res_partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: mailing_contact_res_partner_category_rel mailing_contact_res_partner_category_re_mailing_contact_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_res_partner_category_rel
    ADD CONSTRAINT mailing_contact_res_partner_category_re_mailing_contact_id_fkey FOREIGN KEY (mailing_contact_id) REFERENCES public.mailing_contact(id) ON DELETE CASCADE;


--
-- Name: mailing_contact mailing_contact_title_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact
    ADD CONSTRAINT mailing_contact_title_id_fkey FOREIGN KEY (title_id) REFERENCES public.res_partner_title(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_to_list mailing_contact_to_list_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_to_list
    ADD CONSTRAINT mailing_contact_to_list_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact_to_list mailing_contact_to_list_mailing_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_to_list
    ADD CONSTRAINT mailing_contact_to_list_mailing_list_id_fkey FOREIGN KEY (mailing_list_id) REFERENCES public.mailing_list(id) ON DELETE CASCADE;


--
-- Name: mailing_contact_to_list mailing_contact_to_list_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact_to_list
    ADD CONSTRAINT mailing_contact_to_list_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_contact mailing_contact_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_contact
    ADD CONSTRAINT mailing_contact_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_filter mailing_filter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_filter
    ADD CONSTRAINT mailing_filter_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_filter mailing_filter_mailing_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_filter
    ADD CONSTRAINT mailing_filter_mailing_model_id_fkey FOREIGN KEY (mailing_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mailing_filter mailing_filter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_filter
    ADD CONSTRAINT mailing_filter_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_list mailing_list_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_list
    ADD CONSTRAINT mailing_list_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_list_mailing_list_merge_rel mailing_list_mailing_list_merge_rel_mailing_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_list_mailing_list_merge_rel
    ADD CONSTRAINT mailing_list_mailing_list_merge_rel_mailing_list_id_fkey FOREIGN KEY (mailing_list_id) REFERENCES public.mailing_list(id) ON DELETE CASCADE;


--
-- Name: mailing_list_mailing_list_merge_rel mailing_list_mailing_list_merge_rel_mailing_list_merge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_list_mailing_list_merge_rel
    ADD CONSTRAINT mailing_list_mailing_list_merge_rel_mailing_list_merge_id_fkey FOREIGN KEY (mailing_list_merge_id) REFERENCES public.mailing_list_merge(id) ON DELETE CASCADE;


--
-- Name: mailing_list_merge mailing_list_merge_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_list_merge
    ADD CONSTRAINT mailing_list_merge_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_list_merge mailing_list_merge_dest_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_list_merge
    ADD CONSTRAINT mailing_list_merge_dest_list_id_fkey FOREIGN KEY (dest_list_id) REFERENCES public.mailing_list(id) ON DELETE SET NULL;


--
-- Name: mailing_list_merge mailing_list_merge_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_list_merge
    ADD CONSTRAINT mailing_list_merge_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_list mailing_list_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_list
    ADD CONSTRAINT mailing_list_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_mailing_filter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_mailing_filter_id_fkey FOREIGN KEY (mailing_filter_id) REFERENCES public.mailing_filter(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_mailing_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_mailing_model_id_fkey FOREIGN KEY (mailing_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mailing_mailing mailing_mailing_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE RESTRICT;


--
-- Name: mailing_mailing mailing_mailing_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing_schedule_date mailing_mailing_schedule_date_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing_schedule_date
    ADD CONSTRAINT mailing_mailing_schedule_date_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing_schedule_date mailing_mailing_schedule_date_mass_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing_schedule_date
    ADD CONSTRAINT mailing_mailing_schedule_date_mass_mailing_id_fkey FOREIGN KEY (mass_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE CASCADE;


--
-- Name: mailing_mailing_schedule_date mailing_mailing_schedule_date_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing_schedule_date
    ADD CONSTRAINT mailing_mailing_schedule_date_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE RESTRICT;


--
-- Name: mailing_mailing_test mailing_mailing_test_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing_test
    ADD CONSTRAINT mailing_mailing_test_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing_test mailing_mailing_test_mass_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing_test
    ADD CONSTRAINT mailing_mailing_test_mass_mailing_id_fkey FOREIGN KEY (mass_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE CASCADE;


--
-- Name: mailing_mailing_test mailing_mailing_test_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing_test
    ADD CONSTRAINT mailing_mailing_test_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_mailing mailing_mailing_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_mailing
    ADD CONSTRAINT mailing_mailing_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_trace mailing_trace_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_trace
    ADD CONSTRAINT mailing_trace_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: mailing_trace mailing_trace_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_trace
    ADD CONSTRAINT mailing_trace_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mailing_trace mailing_trace_mail_mail_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_trace
    ADD CONSTRAINT mailing_trace_mail_mail_id_fkey FOREIGN KEY (mail_mail_id) REFERENCES public.mail_mail(id) ON DELETE SET NULL;


--
-- Name: mailing_trace mailing_trace_mass_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_trace
    ADD CONSTRAINT mailing_trace_mass_mailing_id_fkey FOREIGN KEY (mass_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE CASCADE;


--
-- Name: mailing_trace mailing_trace_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mailing_trace
    ADD CONSTRAINT mailing_trace_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mass_mailing_ir_attachments_rel mass_mailing_ir_attachments_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mass_mailing_ir_attachments_rel
    ADD CONSTRAINT mass_mailing_ir_attachments_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: mass_mailing_ir_attachments_rel mass_mailing_ir_attachments_rel_mass_mailing_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mass_mailing_ir_attachments_rel
    ADD CONSTRAINT mass_mailing_ir_attachments_rel_mass_mailing_id_fkey FOREIGN KEY (mass_mailing_id) REFERENCES public.mailing_mailing(id) ON DELETE CASCADE;


--
-- Name: meeting_category_rel meeting_category_rel_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.meeting_category_rel
    ADD CONSTRAINT meeting_category_rel_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: meeting_category_rel meeting_category_rel_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.meeting_category_rel
    ADD CONSTRAINT meeting_category_rel_type_id_fkey FOREIGN KEY (type_id) REFERENCES public.calendar_event_type(id) ON DELETE CASCADE;


--
-- Name: merge_opportunity_rel merge_opportunity_rel_merge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.merge_opportunity_rel
    ADD CONSTRAINT merge_opportunity_rel_merge_id_fkey FOREIGN KEY (merge_id) REFERENCES public.crm_merge_opportunity(id) ON DELETE CASCADE;


--
-- Name: merge_opportunity_rel merge_opportunity_rel_opportunity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.merge_opportunity_rel
    ADD CONSTRAINT merge_opportunity_rel_opportunity_id_fkey FOREIGN KEY (opportunity_id) REFERENCES public.crm_lead(id) ON DELETE CASCADE;


--
-- Name: message_attachment_rel message_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.message_attachment_rel
    ADD CONSTRAINT message_attachment_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: message_attachment_rel message_attachment_rel_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.message_attachment_rel
    ADD CONSTRAINT message_attachment_rel_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: note_note note_note_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_note
    ADD CONSTRAINT note_note_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: note_note note_note_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_note
    ADD CONSTRAINT note_note_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: note_note note_note_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_note
    ADD CONSTRAINT note_note_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: note_note note_note_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_note
    ADD CONSTRAINT note_note_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: note_note note_note_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_note
    ADD CONSTRAINT note_note_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: note_stage note_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_stage
    ADD CONSTRAINT note_stage_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: note_stage_rel note_stage_rel_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_stage_rel
    ADD CONSTRAINT note_stage_rel_note_id_fkey FOREIGN KEY (note_id) REFERENCES public.note_note(id) ON DELETE CASCADE;


--
-- Name: note_stage_rel note_stage_rel_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_stage_rel
    ADD CONSTRAINT note_stage_rel_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.note_stage(id) ON DELETE CASCADE;


--
-- Name: note_stage note_stage_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_stage
    ADD CONSTRAINT note_stage_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: note_stage note_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_stage
    ADD CONSTRAINT note_stage_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: note_tag note_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_tag
    ADD CONSTRAINT note_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: note_tag note_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_tag
    ADD CONSTRAINT note_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: note_tags_rel note_tags_rel_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_tags_rel
    ADD CONSTRAINT note_tags_rel_note_id_fkey FOREIGN KEY (note_id) REFERENCES public.note_note(id) ON DELETE CASCADE;


--
-- Name: note_tags_rel note_tags_rel_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.note_tags_rel
    ADD CONSTRAINT note_tags_rel_tag_id_fkey FOREIGN KEY (tag_id) REFERENCES public.note_tag(id) ON DELETE CASCADE;


--
-- Name: payment_country_rel payment_country_rel_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_country_rel
    ADD CONSTRAINT payment_country_rel_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: payment_country_rel payment_country_rel_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_country_rel
    ADD CONSTRAINT payment_country_rel_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.payment_provider(id) ON DELETE CASCADE;


--
-- Name: payment_icon payment_icon_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_icon
    ADD CONSTRAINT payment_icon_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_icon_payment_provider_rel payment_icon_payment_provider_rel_payment_icon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_icon_payment_provider_rel
    ADD CONSTRAINT payment_icon_payment_provider_rel_payment_icon_id_fkey FOREIGN KEY (payment_icon_id) REFERENCES public.payment_icon(id) ON DELETE CASCADE;


--
-- Name: payment_icon_payment_provider_rel payment_icon_payment_provider_rel_payment_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_icon_payment_provider_rel
    ADD CONSTRAINT payment_icon_payment_provider_rel_payment_provider_id_fkey FOREIGN KEY (payment_provider_id) REFERENCES public.payment_provider(id) ON DELETE CASCADE;


--
-- Name: payment_icon payment_icon_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_icon
    ADD CONSTRAINT payment_icon_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_link_wizard payment_link_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_link_wizard payment_link_wizard_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: payment_link_wizard payment_link_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: payment_link_wizard payment_link_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider payment_provider_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider payment_provider_express_checkout_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_express_checkout_form_view_id_fkey FOREIGN KEY (express_checkout_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_inline_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_inline_form_view_id_fkey FOREIGN KEY (inline_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE SET NULL;


--
-- Name: payment_provider_onboarding_wizard payment_provider_onboarding_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider_onboarding_wizard
    ADD CONSTRAINT payment_provider_onboarding_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider_onboarding_wizard payment_provider_onboarding_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider_onboarding_wizard
    ADD CONSTRAINT payment_provider_onboarding_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider payment_provider_redirect_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_redirect_form_view_id_fkey FOREIGN KEY (redirect_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_token_inline_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_token_inline_form_view_id_fkey FOREIGN KEY (token_inline_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_refund_wizard payment_refund_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_refund_wizard
    ADD CONSTRAINT payment_refund_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_refund_wizard payment_refund_wizard_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_refund_wizard
    ADD CONSTRAINT payment_refund_wizard_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: payment_refund_wizard payment_refund_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_refund_wizard
    ADD CONSTRAINT payment_refund_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_token payment_token_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: payment_token payment_token_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_token payment_token_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: payment_token payment_token_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_provider_id_fkey FOREIGN KEY (provider_id) REFERENCES public.payment_provider(id) ON DELETE RESTRICT;


--
-- Name: payment_token payment_token_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_callback_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_callback_model_id_fkey FOREIGN KEY (callback_model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_partner_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_partner_country_id_fkey FOREIGN KEY (partner_country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_partner_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_partner_state_id_fkey FOREIGN KEY (partner_state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_provider_id_fkey FOREIGN KEY (provider_id) REFERENCES public.payment_provider(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_source_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_source_transaction_id_fkey FOREIGN KEY (source_transaction_id) REFERENCES public.payment_transaction(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_token_id_fkey FOREIGN KEY (token_id) REFERENCES public.payment_token(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist phone_blacklist_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.phone_blacklist
    ADD CONSTRAINT phone_blacklist_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist phone_blacklist_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.phone_blacklist
    ADD CONSTRAINT phone_blacklist_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist_remove phone_blacklist_remove_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.phone_blacklist_remove
    ADD CONSTRAINT phone_blacklist_remove_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist_remove phone_blacklist_remove_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.phone_blacklist_remove
    ADD CONSTRAINT phone_blacklist_remove_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist phone_blacklist_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.phone_blacklist
    ADD CONSTRAINT phone_blacklist_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: picking_label_type picking_label_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.picking_label_type
    ADD CONSTRAINT picking_label_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: picking_label_type_stock_picking_rel picking_label_type_stock_picking_rel_picking_label_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.picking_label_type_stock_picking_rel
    ADD CONSTRAINT picking_label_type_stock_picking_rel_picking_label_type_id_fkey FOREIGN KEY (picking_label_type_id) REFERENCES public.picking_label_type(id) ON DELETE CASCADE;


--
-- Name: picking_label_type_stock_picking_rel picking_label_type_stock_picking_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.picking_label_type_stock_picking_rel
    ADD CONSTRAINT picking_label_type_stock_picking_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: picking_label_type picking_label_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.picking_label_type
    ADD CONSTRAINT picking_label_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_share portal_share_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_share
    ADD CONSTRAINT portal_share_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_share_res_partner_rel portal_share_res_partner_rel_portal_share_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_share_res_partner_rel
    ADD CONSTRAINT portal_share_res_partner_rel_portal_share_id_fkey FOREIGN KEY (portal_share_id) REFERENCES public.portal_share(id) ON DELETE CASCADE;


--
-- Name: portal_share_res_partner_rel portal_share_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_share_res_partner_rel
    ADD CONSTRAINT portal_share_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: portal_share portal_share_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_share
    ADD CONSTRAINT portal_share_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard portal_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard
    ADD CONSTRAINT portal_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard_res_partner_rel portal_wizard_res_partner_rel_portal_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard_res_partner_rel
    ADD CONSTRAINT portal_wizard_res_partner_rel_portal_wizard_id_fkey FOREIGN KEY (portal_wizard_id) REFERENCES public.portal_wizard(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_res_partner_rel portal_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard_res_partner_rel
    ADD CONSTRAINT portal_wizard_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_user portal_wizard_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard_user portal_wizard_user_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_user portal_wizard_user_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.portal_wizard(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_user portal_wizard_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard portal_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.portal_wizard
    ADD CONSTRAINT portal_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_log privacy_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_log
    ADD CONSTRAINT privacy_log_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_log privacy_log_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_log
    ADD CONSTRAINT privacy_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: privacy_log privacy_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_log
    ADD CONSTRAINT privacy_log_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard privacy_lookup_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_lookup_wizard
    ADD CONSTRAINT privacy_lookup_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.privacy_lookup_wizard(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard privacy_lookup_wizard_log_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_lookup_wizard
    ADD CONSTRAINT privacy_lookup_wizard_log_id_fkey FOREIGN KEY (log_id) REFERENCES public.privacy_log(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard privacy_lookup_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.privacy_lookup_wizard
    ADD CONSTRAINT privacy_lookup_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: procurement_group procurement_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.procurement_group
    ADD CONSTRAINT procurement_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: procurement_group procurement_group_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.procurement_group
    ADD CONSTRAINT procurement_group_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: procurement_group procurement_group_sale_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.procurement_group
    ADD CONSTRAINT procurement_group_sale_id_fkey FOREIGN KEY (sale_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: procurement_group procurement_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.procurement_group
    ADD CONSTRAINT procurement_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attr_exclusion_value_ids_rel product_attr_exclusion_value__product_template_attribute_e_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attr_exclusion_value_ids_rel
    ADD CONSTRAINT product_attr_exclusion_value__product_template_attribute_e_fkey FOREIGN KEY (product_template_attribute_exclusion_id) REFERENCES public.product_template_attribute_exclusion(id) ON DELETE CASCADE;


--
-- Name: product_attr_exclusion_value_ids_rel product_attr_exclusion_value__product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attr_exclusion_value_ids_rel
    ADD CONSTRAINT product_attr_exclusion_value__product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_attribute product_attribute_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute
    ADD CONSTRAINT product_attribute_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_custom_value product_attribute_custom_valu_custom_product_template_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_valu_custom_product_template_attr_fkey FOREIGN KEY (custom_product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_attribute_custom_value product_attribute_custom_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_custom_value product_attribute_custom_value_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_value_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: product_attribute_custom_value product_attribute_custom_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_product_template_rel product_attribute_product_template_re_product_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_product_template_rel
    ADD CONSTRAINT product_attribute_product_template_re_product_attribute_id_fkey FOREIGN KEY (product_attribute_id) REFERENCES public.product_attribute(id) ON DELETE CASCADE;


--
-- Name: product_attribute_product_template_rel product_attribute_product_template_rel_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_product_template_rel
    ADD CONSTRAINT product_attribute_product_template_rel_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_attribute_value product_attribute_value_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_value
    ADD CONSTRAINT product_attribute_value_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE CASCADE;


--
-- Name: product_attribute_value product_attribute_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_value
    ADD CONSTRAINT product_attribute_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_value_product_template_attribute_line_rel product_attribute_value_produ_product_template_attribute_l_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_value_product_template_attribute_line_rel
    ADD CONSTRAINT product_attribute_value_produ_product_template_attribute_l_fkey FOREIGN KEY (product_template_attribute_line_id) REFERENCES public.product_template_attribute_line(id) ON DELETE CASCADE;


--
-- Name: product_attribute_value_product_template_attribute_line_rel product_attribute_value_product_product_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_value_product_template_attribute_line_rel
    ADD CONSTRAINT product_attribute_value_product_product_attribute_value_id_fkey FOREIGN KEY (product_attribute_value_id) REFERENCES public.product_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_attribute_value product_attribute_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute_value
    ADD CONSTRAINT product_attribute_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute product_attribute_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_attribute
    ADD CONSTRAINT product_attribute_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_category product_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_category
    ADD CONSTRAINT product_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_category product_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_category
    ADD CONSTRAINT product_category_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: product_category product_category_removal_strategy_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_category
    ADD CONSTRAINT product_category_removal_strategy_id_fkey FOREIGN KEY (removal_strategy_id) REFERENCES public.product_removal(id) ON DELETE SET NULL;


--
-- Name: product_category product_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_category
    ADD CONSTRAINT product_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_label_layout product_label_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout
    ADD CONSTRAINT product_label_layout_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_label_layout_product_product_rel product_label_layout_product_produ_product_label_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout_product_product_rel
    ADD CONSTRAINT product_label_layout_product_produ_product_label_layout_id_fkey FOREIGN KEY (product_label_layout_id) REFERENCES public.product_label_layout(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_product_product_rel product_label_layout_product_product_re_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout_product_product_rel
    ADD CONSTRAINT product_label_layout_product_product_re_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_product_template_rel product_label_layout_product_templ_product_label_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout_product_template_rel
    ADD CONSTRAINT product_label_layout_product_templ_product_label_layout_id_fkey FOREIGN KEY (product_label_layout_id) REFERENCES public.product_label_layout(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_product_template_rel product_label_layout_product_template__product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout_product_template_rel
    ADD CONSTRAINT product_label_layout_product_template__product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_stock_move_line_rel product_label_layout_stock_move_li_product_label_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout_stock_move_line_rel
    ADD CONSTRAINT product_label_layout_stock_move_li_product_label_layout_id_fkey FOREIGN KEY (product_label_layout_id) REFERENCES public.product_label_layout(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_stock_move_line_rel product_label_layout_stock_move_line_re_stock_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout_stock_move_line_rel
    ADD CONSTRAINT product_label_layout_stock_move_line_re_stock_move_line_id_fkey FOREIGN KEY (stock_move_line_id) REFERENCES public.stock_move_line(id) ON DELETE CASCADE;


--
-- Name: product_label_layout product_label_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_label_layout
    ADD CONSTRAINT product_label_layout_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_optional_rel product_optional_rel_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_optional_rel
    ADD CONSTRAINT product_optional_rel_dest_id_fkey FOREIGN KEY (dest_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_optional_rel product_optional_rel_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_optional_rel
    ADD CONSTRAINT product_optional_rel_src_id_fkey FOREIGN KEY (src_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_packaging product_packaging_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_packaging
    ADD CONSTRAINT product_packaging_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_packaging product_packaging_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_packaging
    ADD CONSTRAINT product_packaging_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_packaging product_packaging_package_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_packaging
    ADD CONSTRAINT product_packaging_package_type_id_fkey FOREIGN KEY (package_type_id) REFERENCES public.stock_package_type(id) ON DELETE SET NULL;


--
-- Name: product_packaging product_packaging_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_packaging
    ADD CONSTRAINT product_packaging_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: product_packaging product_packaging_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_packaging
    ADD CONSTRAINT product_packaging_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_pricelist product_pricelist_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_pricelist product_pricelist_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_pricelist product_pricelist_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: product_pricelist_item product_pricelist_item_base_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_base_pricelist_id_fkey FOREIGN KEY (base_pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_pricelist product_pricelist_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_product product_product_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_product product_product_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: product_product product_product_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_product_stock_track_confirmation_rel product_product_stock_track_co_stock_track_confirmation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_product_stock_track_confirmation_rel
    ADD CONSTRAINT product_product_stock_track_co_stock_track_confirmation_id_fkey FOREIGN KEY (stock_track_confirmation_id) REFERENCES public.stock_track_confirmation(id) ON DELETE CASCADE;


--
-- Name: product_product_stock_track_confirmation_rel product_product_stock_track_confirmatio_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_product_stock_track_confirmation_rel
    ADD CONSTRAINT product_product_stock_track_confirmatio_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_product product_product_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_removal product_removal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_removal
    ADD CONSTRAINT product_removal_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_removal product_removal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_removal
    ADD CONSTRAINT product_removal_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_replenish product_replenish_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_replenish product_replenish_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_replenish product_replenish_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE CASCADE;


--
-- Name: product_replenish_stock_route_rel product_replenish_stock_route_rel_product_replenish_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish_stock_route_rel
    ADD CONSTRAINT product_replenish_stock_route_rel_product_replenish_id_fkey FOREIGN KEY (product_replenish_id) REFERENCES public.product_replenish(id) ON DELETE CASCADE;


--
-- Name: product_replenish_stock_route_rel product_replenish_stock_route_rel_stock_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish_stock_route_rel
    ADD CONSTRAINT product_replenish_stock_route_rel_stock_route_id_fkey FOREIGN KEY (stock_route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_supplier_taxes_rel product_supplier_taxes_rel_prod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplier_taxes_rel
    ADD CONSTRAINT product_supplier_taxes_rel_prod_id_fkey FOREIGN KEY (prod_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_supplier_taxes_rel product_supplier_taxes_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplier_taxes_rel
    ADD CONSTRAINT product_supplier_taxes_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: product_supplierinfo product_supplierinfo_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo_stock_replenishment_info_rel product_supplierinfo_stock_rep_stock_replenishment_info_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo_stock_replenishment_info_rel
    ADD CONSTRAINT product_supplierinfo_stock_rep_stock_replenishment_info_id_fkey FOREIGN KEY (stock_replenishment_info_id) REFERENCES public.stock_replenishment_info(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo_stock_replenishment_info_rel product_supplierinfo_stock_repleni_product_supplierinfo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo_stock_replenishment_info_rel
    ADD CONSTRAINT product_supplierinfo_stock_repleni_product_supplierinfo_id_fkey FOREIGN KEY (product_supplierinfo_id) REFERENCES public.product_supplierinfo(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_tag product_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag
    ADD CONSTRAINT product_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_tag_product_product_rel product_tag_product_product_rel_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_product_rel
    ADD CONSTRAINT product_tag_product_product_rel_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_product_rel product_tag_product_product_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_product_rel
    ADD CONSTRAINT product_tag_product_product_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_template_rel product_tag_product_template_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_template_rel
    ADD CONSTRAINT product_tag_product_template_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_template_rel product_tag_product_template_rel_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_template_rel
    ADD CONSTRAINT product_tag_product_template_rel_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_tag product_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag
    ADD CONSTRAINT product_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_taxes_rel product_taxes_rel_prod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_taxes_rel
    ADD CONSTRAINT product_taxes_rel_prod_id_fkey FOREIGN KEY (prod_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_taxes_rel product_taxes_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_taxes_rel
    ADD CONSTRAINT product_taxes_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_ex_product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_ex_product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_exclusion_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_exclusion_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_exclusion_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_line product_template_attribute_line_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE RESTRICT;


--
-- Name: product_template_attribute_line product_template_attribute_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_line product_template_attribute_line_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_line product_template_attribute_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value_sale_order_line_rel product_template_attribute_va_product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value_sale_order_line_rel
    ADD CONSTRAINT product_template_attribute_va_product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_template_attribute_value product_template_attribute_valu_product_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_valu_product_attribute_value_id_fkey FOREIGN KEY (product_attribute_value_id) REFERENCES public.product_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value product_template_attribute_value_attribute_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_attribute_line_id_fkey FOREIGN KEY (attribute_line_id) REFERENCES public.product_template_attribute_line(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value product_template_attribute_value_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value_sale_order_line_rel product_template_attribute_value_sale_o_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value_sale_order_line_rel
    ADD CONSTRAINT product_template_attribute_value_sale_o_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE RESTRICT;


--
-- Name: product_template product_template_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: product_template product_template_uom_po_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_uom_po_id_fkey FOREIGN KEY (uom_po_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: product_template product_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_variant_combination product_variant_combination_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_variant_combination
    ADD CONSTRAINT product_variant_combination_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_variant_combination product_variant_combination_product_template_attribute_val_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_variant_combination
    ADD CONSTRAINT product_variant_combination_product_template_attribute_val_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: project_collaborator project_collaborator_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_collaborator
    ADD CONSTRAINT project_collaborator_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_collaborator project_collaborator_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_collaborator
    ADD CONSTRAINT project_collaborator_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: project_collaborator project_collaborator_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_collaborator
    ADD CONSTRAINT project_collaborator_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE RESTRICT;


--
-- Name: project_collaborator project_collaborator_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_collaborator
    ADD CONSTRAINT project_collaborator_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_favorite_user_rel project_favorite_user_rel_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_favorite_user_rel
    ADD CONSTRAINT project_favorite_user_rel_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_favorite_user_rel project_favorite_user_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_favorite_user_rel
    ADD CONSTRAINT project_favorite_user_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: project_milestone project_milestone_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_milestone
    ADD CONSTRAINT project_milestone_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_milestone project_milestone_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_milestone
    ADD CONSTRAINT project_milestone_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: project_milestone project_milestone_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_milestone
    ADD CONSTRAINT project_milestone_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_milestone project_milestone_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_milestone
    ADD CONSTRAINT project_milestone_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: project_milestone project_milestone_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_milestone
    ADD CONSTRAINT project_milestone_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_alias_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_alias_id_fkey FOREIGN KEY (alias_id) REFERENCES public.mail_alias(id) ON DELETE RESTRICT;


--
-- Name: project_project project_project_analytic_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_analytic_account_id_fkey FOREIGN KEY (analytic_account_id) REFERENCES public.account_analytic_account(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: project_project project_project_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_last_update_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_last_update_id_fkey FOREIGN KEY (last_update_id) REFERENCES public.project_update(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: project_project_project_tags_rel project_project_project_tags_rel_project_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_tags_rel
    ADD CONSTRAINT project_project_project_tags_rel_project_project_id_fkey FOREIGN KEY (project_project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_project_project_tags_rel project_project_project_tags_rel_project_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_tags_rel
    ADD CONSTRAINT project_project_project_tags_rel_project_tags_id_fkey FOREIGN KEY (project_tags_id) REFERENCES public.project_tags(id) ON DELETE CASCADE;


--
-- Name: project_project_project_task_type_delete_wizard_rel project_project_project_task__project_task_type_delete_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_project_project_task__project_task_type_delete_wiz_fkey FOREIGN KEY (project_task_type_delete_wizard_id) REFERENCES public.project_task_type_delete_wizard(id) ON DELETE CASCADE;


--
-- Name: project_project_project_task_type_delete_wizard_rel project_project_project_task_type_delet_project_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_project_project_task_type_delet_project_project_id_fkey FOREIGN KEY (project_project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_project project_project_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: project_project_stage project_project_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage
    ADD CONSTRAINT project_project_stage_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.project_project_stage(id) ON DELETE RESTRICT;


--
-- Name: project_project_stage project_project_stage_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage
    ADD CONSTRAINT project_project_stage_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: project_project_stage project_project_stage_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage
    ADD CONSTRAINT project_project_stage_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: project_project_stage project_project_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage
    ADD CONSTRAINT project_project_stage_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_share_wizard project_share_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_wizard
    ADD CONSTRAINT project_share_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_share_wizard_res_partner_rel project_share_wizard_res_partner_r_project_share_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_wizard_res_partner_rel
    ADD CONSTRAINT project_share_wizard_res_partner_r_project_share_wizard_id_fkey FOREIGN KEY (project_share_wizard_id) REFERENCES public.project_share_wizard(id) ON DELETE CASCADE;


--
-- Name: project_share_wizard_res_partner_rel project_share_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_wizard_res_partner_rel
    ADD CONSTRAINT project_share_wizard_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: project_share_wizard project_share_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_wizard
    ADD CONSTRAINT project_share_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_tags project_tags_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_tags
    ADD CONSTRAINT project_tags_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_tags_project_task_rel project_tags_project_task_rel_project_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_tags_project_task_rel
    ADD CONSTRAINT project_tags_project_task_rel_project_tags_id_fkey FOREIGN KEY (project_tags_id) REFERENCES public.project_tags(id) ON DELETE CASCADE;


--
-- Name: project_tags_project_task_rel project_tags_project_task_rel_project_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_tags_project_task_rel
    ADD CONSTRAINT project_tags_project_task_rel_project_task_id_fkey FOREIGN KEY (project_task_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: project_tags project_tags_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_tags
    ADD CONSTRAINT project_tags_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_analytic_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_analytic_account_id_fkey FOREIGN KEY (analytic_account_id) REFERENCES public.account_analytic_account(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_ancestor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_ancestor_id_fkey FOREIGN KEY (ancestor_id) REFERENCES public.project_task(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: project_task project_task_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_display_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_display_project_id_fkey FOREIGN KEY (display_project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_displayed_image_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_displayed_image_id_fkey FOREIGN KEY (displayed_image_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_milestone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_milestone_id_fkey FOREIGN KEY (milestone_id) REFERENCES public.project_milestone(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.project_task(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: project_task_recurrence project_task_recurrence_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_recurrence
    ADD CONSTRAINT project_task_recurrence_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_recurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_recurrence_id_fkey FOREIGN KEY (recurrence_id) REFERENCES public.project_task_recurrence(id) ON DELETE SET NULL;


--
-- Name: project_task_recurrence project_task_recurrence_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_recurrence
    ADD CONSTRAINT project_task_recurrence_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.project_task_type(id) ON DELETE RESTRICT;


--
-- Name: project_task_type project_task_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task_type_delete_wizard project_task_type_delete_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_delete_wizard
    ADD CONSTRAINT project_task_type_delete_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task_type_delete_wizard project_task_type_delete_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_delete_wizard
    ADD CONSTRAINT project_task_type_delete_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task_type project_task_type_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: project_task_type_project_task_type_delete_wizard_rel project_task_type_project_tas_project_task_type_delete_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_task_type_project_tas_project_task_type_delete_wiz_fkey FOREIGN KEY (project_task_type_delete_wizard_id) REFERENCES public.project_task_type_delete_wizard(id) ON DELETE CASCADE;


--
-- Name: project_task_type_project_task_type_delete_wizard_rel project_task_type_project_task_type_d_project_task_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_task_type_project_task_type_d_project_task_type_id_fkey FOREIGN KEY (project_task_type_id) REFERENCES public.project_task_type(id) ON DELETE CASCADE;


--
-- Name: project_task_type project_task_type_rating_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_rating_template_id_fkey FOREIGN KEY (rating_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: project_task_type_rel project_task_type_rel_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_rel
    ADD CONSTRAINT project_task_type_rel_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_task_type_rel project_task_type_rel_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_rel
    ADD CONSTRAINT project_task_type_rel_type_id_fkey FOREIGN KEY (type_id) REFERENCES public.project_task_type(id) ON DELETE CASCADE;


--
-- Name: project_task_type project_task_type_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: project_task_type project_task_type_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task_type project_task_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task_user_rel project_task_user_rel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task_user_rel project_task_user_rel_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.project_task_type(id) ON DELETE RESTRICT;


--
-- Name: project_task_user_rel project_task_user_rel_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_task_id_fkey FOREIGN KEY (task_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: project_task_user_rel project_task_user_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: project_task_user_rel project_task_user_rel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_update project_update_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_update
    ADD CONSTRAINT project_update_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_update project_update_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_update
    ADD CONSTRAINT project_update_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: project_update project_update_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_update
    ADD CONSTRAINT project_update_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE RESTRICT;


--
-- Name: project_update project_update_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_update
    ADD CONSTRAINT project_update_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: project_update project_update_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_update
    ADD CONSTRAINT project_update_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: purchase_order purchase_order_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: purchase_order purchase_order_dest_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_dest_address_id_fkey FOREIGN KEY (dest_address_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_incoterm_id_fkey FOREIGN KEY (incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.purchase_order(id) ON DELETE CASCADE;


--
-- Name: purchase_order_line purchase_order_line_orderpoint_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_orderpoint_id_fkey FOREIGN KEY (orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_product_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_product_packaging_id_fkey FOREIGN KEY (product_packaging_id) REFERENCES public.product_packaging(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_product_uom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_product_uom_fkey FOREIGN KEY (product_uom) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: purchase_order purchase_order_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_payment_term_id_fkey FOREIGN KEY (payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE RESTRICT;


--
-- Name: purchase_order_stock_picking_rel purchase_order_stock_picking_rel_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_stock_picking_rel
    ADD CONSTRAINT purchase_order_stock_picking_rel_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE CASCADE;


--
-- Name: purchase_order_stock_picking_rel purchase_order_stock_picking_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_stock_picking_rel
    ADD CONSTRAINT purchase_order_stock_picking_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: purchase_order purchase_order_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_parent_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_parent_res_model_id_fkey FOREIGN KEY (parent_res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_publisher_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_publisher_id_fkey FOREIGN KEY (publisher_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_rated_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_rated_partner_id_fkey FOREIGN KEY (rated_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rel_badge_auth_users rel_badge_auth_users_gamification_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_badge_auth_users
    ADD CONSTRAINT rel_badge_auth_users_gamification_badge_id_fkey FOREIGN KEY (gamification_badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: rel_badge_auth_users rel_badge_auth_users_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_badge_auth_users
    ADD CONSTRAINT rel_badge_auth_users_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: rel_modules_langexport rel_modules_langexport_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_modules_langexport
    ADD CONSTRAINT rel_modules_langexport_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: rel_modules_langexport rel_modules_langexport_wiz_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_modules_langexport
    ADD CONSTRAINT rel_modules_langexport_wiz_id_fkey FOREIGN KEY (wiz_id) REFERENCES public.base_language_export(id) ON DELETE CASCADE;


--
-- Name: rel_server_actions rel_server_actions_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_server_actions
    ADD CONSTRAINT rel_server_actions_action_id_fkey FOREIGN KEY (action_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: rel_server_actions rel_server_actions_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_server_actions
    ADD CONSTRAINT rel_server_actions_server_id_fkey FOREIGN KEY (server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: report_layout report_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.report_layout
    ADD CONSTRAINT report_layout_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: report_layout report_layout_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.report_layout
    ADD CONSTRAINT report_layout_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: report_layout report_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.report_layout
    ADD CONSTRAINT report_layout_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: report_paperformat report_paperformat_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.report_paperformat
    ADD CONSTRAINT report_paperformat_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: report_paperformat report_paperformat_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.report_paperformat
    ADD CONSTRAINT report_paperformat_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_country_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_country_fkey FOREIGN KEY (country) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_state_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_state_fkey FOREIGN KEY (state) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_cash_basis_base_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_cash_basis_base_account_id_fkey FOREIGN KEY (account_cash_basis_base_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_default_pos_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_default_pos_receivable_account_id_fkey FOREIGN KEY (account_default_pos_receivable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_fiscal_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_fiscal_country_id_fkey FOREIGN KEY (account_fiscal_country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_early_pay_discount_gain_accoun_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_early_pay_discount_gain_accoun_fkey FOREIGN KEY (account_journal_early_pay_discount_gain_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_early_pay_discount_loss_accoun_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_early_pay_discount_loss_accoun_fkey FOREIGN KEY (account_journal_early_pay_discount_loss_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_payment_credit_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_payment_credit_account_id_fkey FOREIGN KEY (account_journal_payment_credit_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_payment_debit_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_payment_debit_account_id_fkey FOREIGN KEY (account_journal_payment_debit_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_suspense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_suspense_account_id_fkey FOREIGN KEY (account_journal_suspense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_opening_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_opening_move_id_fkey FOREIGN KEY (account_opening_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_purchase_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_purchase_tax_id_fkey FOREIGN KEY (account_purchase_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_sale_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_sale_tax_id_fkey FOREIGN KEY (account_sale_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_automatic_entry_default_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_automatic_entry_default_journal_id_fkey FOREIGN KEY (automatic_entry_default_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_chart_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_chart_template_id_fkey FOREIGN KEY (chart_template_id) REFERENCES public.account_chart_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_company_expense_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_company_expense_journal_id_fkey FOREIGN KEY (company_expense_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_currency_exchange_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_currency_exchange_journal_id_fkey FOREIGN KEY (currency_exchange_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_default_cash_difference_expense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_default_cash_difference_expense_account_id_fkey FOREIGN KEY (default_cash_difference_expense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_default_cash_difference_income_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_default_cash_difference_income_account_id_fkey FOREIGN KEY (default_cash_difference_income_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_accrual_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_accrual_account_id_fkey FOREIGN KEY (expense_accrual_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_currency_exchange_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_currency_exchange_account_id_fkey FOREIGN KEY (expense_currency_exchange_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_journal_id_fkey FOREIGN KEY (expense_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_external_report_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_external_report_layout_id_fkey FOREIGN KEY (external_report_layout_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_income_currency_exchange_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_income_currency_exchange_account_id_fkey FOREIGN KEY (income_currency_exchange_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_incoterm_id_fkey FOREIGN KEY (incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_internal_transit_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_internal_transit_location_id_fkey FOREIGN KEY (internal_transit_location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_nomenclature_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_nomenclature_id_fkey FOREIGN KEY (nomenclature_id) REFERENCES public.barcode_nomenclature(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_paperformat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_paperformat_id_fkey FOREIGN KEY (paperformat_id) REFERENCES public.report_paperformat(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_property_stock_account_input_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_property_stock_account_input_categ_id_fkey FOREIGN KEY (property_stock_account_input_categ_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_property_stock_account_output_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_property_stock_account_output_categ_id_fkey FOREIGN KEY (property_stock_account_output_categ_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_property_stock_valuation_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_property_stock_valuation_account_id_fkey FOREIGN KEY (property_stock_valuation_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_resource_calendar_id_fkey FOREIGN KEY (resource_calendar_id) REFERENCES public.resource_calendar(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_revenue_accrual_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_revenue_accrual_account_id_fkey FOREIGN KEY (revenue_accrual_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_stock_mail_confirmation_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_stock_mail_confirmation_template_id_fkey FOREIGN KEY (stock_mail_confirmation_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_stock_sms_confirmation_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_stock_sms_confirmation_template_id_fkey FOREIGN KEY (stock_sms_confirmation_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_tax_cash_basis_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_tax_cash_basis_journal_id_fkey FOREIGN KEY (tax_cash_basis_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_transfer_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_transfer_account_id_fkey FOREIGN KEY (transfer_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company_users_rel res_company_users_rel_cid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company_users_rel
    ADD CONSTRAINT res_company_users_rel_cid_fkey FOREIGN KEY (cid) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: res_company_users_rel res_company_users_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company_users_rel
    ADD CONSTRAINT res_company_users_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_company res_company_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config res_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config
    ADD CONSTRAINT res_config_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_installer res_config_installer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_installer
    ADD CONSTRAINT res_config_installer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_installer res_config_installer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_installer
    ADD CONSTRAINT res_config_installer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_auth_signup_template_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_auth_signup_template_user_id_fkey FOREIGN KEY (auth_signup_template_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_chart_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_chart_template_id_fkey FOREIGN KEY (chart_template_id) REFERENCES public.account_chart_template(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: res_config_settings res_config_settings_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_deposit_default_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_deposit_default_product_id_fkey FOREIGN KEY (deposit_default_product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_digest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_digest_id_fkey FOREIGN KEY (digest_id) REFERENCES public.digest_digest(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_invoice_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_invoice_mail_template_id_fkey FOREIGN KEY (invoice_mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_mass_mailing_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_mass_mailing_mail_server_id_fkey FOREIGN KEY (mass_mailing_mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: res_config_settings res_config_settings_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config res_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config
    ADD CONSTRAINT res_config_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_address_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_address_view_id_fkey FOREIGN KEY (address_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: res_country_group res_country_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_group
    ADD CONSTRAINT res_country_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country_group_pricelist_rel res_country_group_pricelist_rel_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_group_pricelist_rel
    ADD CONSTRAINT res_country_group_pricelist_rel_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE CASCADE;


--
-- Name: res_country_group_pricelist_rel res_country_group_pricelist_rel_res_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_group_pricelist_rel
    ADD CONSTRAINT res_country_group_pricelist_rel_res_country_group_id_fkey FOREIGN KEY (res_country_group_id) REFERENCES public.res_country_group(id) ON DELETE CASCADE;


--
-- Name: res_country_group res_country_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_group
    ADD CONSTRAINT res_country_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country_res_country_group_rel res_country_res_country_group_rel_res_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_res_country_group_rel
    ADD CONSTRAINT res_country_res_country_group_rel_res_country_group_id_fkey FOREIGN KEY (res_country_group_id) REFERENCES public.res_country_group(id) ON DELETE CASCADE;


--
-- Name: res_country_res_country_group_rel res_country_res_country_group_rel_res_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_res_country_group_rel
    ADD CONSTRAINT res_country_res_country_group_rel_res_country_id_fkey FOREIGN KEY (res_country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: res_country_state res_country_state_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_state
    ADD CONSTRAINT res_country_state_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: res_country_state res_country_state_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_state
    ADD CONSTRAINT res_country_state_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country_state res_country_state_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_state
    ADD CONSTRAINT res_country_state_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency res_currency_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency
    ADD CONSTRAINT res_currency_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency_rate res_currency_rate_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_currency_rate res_currency_rate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency_rate res_currency_rate_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE CASCADE;


--
-- Name: res_currency_rate res_currency_rate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency res_currency_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency
    ADD CONSTRAINT res_currency_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_groups res_groups_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups
    ADD CONSTRAINT res_groups_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.ir_module_category(id) ON DELETE SET NULL;


--
-- Name: res_groups res_groups_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups
    ADD CONSTRAINT res_groups_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_groups_implied_rel res_groups_implied_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_implied_rel
    ADD CONSTRAINT res_groups_implied_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_implied_rel res_groups_implied_rel_hid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_implied_rel
    ADD CONSTRAINT res_groups_implied_rel_hid_fkey FOREIGN KEY (hid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_report_rel res_groups_report_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_report_rel
    ADD CONSTRAINT res_groups_report_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_report_rel res_groups_report_rel_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_report_rel
    ADD CONSTRAINT res_groups_report_rel_uid_fkey FOREIGN KEY (uid) REFERENCES public.ir_act_report_xml(id) ON DELETE CASCADE;


--
-- Name: res_groups_spreadsheet_dashboard_rel res_groups_spreadsheet_dashboard__spreadsheet_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_groups_spreadsheet_dashboard__spreadsheet_dashboard_id_fkey FOREIGN KEY (spreadsheet_dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: res_groups_spreadsheet_dashboard_rel res_groups_spreadsheet_dashboard_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_groups_spreadsheet_dashboard_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_users_rel res_groups_users_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_users_rel
    ADD CONSTRAINT res_groups_users_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_users_rel res_groups_users_rel_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_users_rel
    ADD CONSTRAINT res_groups_users_rel_uid_fkey FOREIGN KEY (uid) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_groups res_groups_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups
    ADD CONSTRAINT res_groups_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_lang res_lang_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_lang
    ADD CONSTRAINT res_lang_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_lang_install_rel res_lang_install_rel_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_lang_install_rel
    ADD CONSTRAINT res_lang_install_rel_lang_id_fkey FOREIGN KEY (lang_id) REFERENCES public.res_lang(id) ON DELETE CASCADE;


--
-- Name: res_lang_install_rel res_lang_install_rel_language_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_lang_install_rel
    ADD CONSTRAINT res_lang_install_rel_language_wizard_id_fkey FOREIGN KEY (language_wizard_id) REFERENCES public.base_language_install(id) ON DELETE CASCADE;


--
-- Name: res_lang res_lang_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_lang
    ADD CONSTRAINT res_lang_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_autocomplete_sync res_partner_autocomplete_sync_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_autocomplete_sync
    ADD CONSTRAINT res_partner_autocomplete_sync_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_autocomplete_sync res_partner_autocomplete_sync_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_autocomplete_sync
    ADD CONSTRAINT res_partner_autocomplete_sync_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner_autocomplete_sync res_partner_autocomplete_sync_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_autocomplete_sync
    ADD CONSTRAINT res_partner_autocomplete_sync_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_bank_id_fkey FOREIGN KEY (bank_id) REFERENCES public.res_bank(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner_bank res_partner_bank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_category res_partner_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_category
    ADD CONSTRAINT res_partner_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_category res_partner_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_category
    ADD CONSTRAINT res_partner_category_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: res_partner_category res_partner_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_category
    ADD CONSTRAINT res_partner_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_commercial_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_commercial_partner_id_fkey FOREIGN KEY (commercial_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: res_partner res_partner_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_industry res_partner_industry_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_industry
    ADD CONSTRAINT res_partner_industry_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_industry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_industry_id_fkey FOREIGN KEY (industry_id) REFERENCES public.res_partner_industry(id) ON DELETE SET NULL;


--
-- Name: res_partner_industry res_partner_industry_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_industry
    ADD CONSTRAINT res_partner_industry_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: res_partner_res_partner_category_rel res_partner_res_partner_category_rel_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_res_partner_category_rel
    ADD CONSTRAINT res_partner_res_partner_category_rel_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: res_partner_res_partner_category_rel res_partner_res_partner_category_rel_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_res_partner_category_rel
    ADD CONSTRAINT res_partner_res_partner_category_rel_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner res_partner_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE RESTRICT;


--
-- Name: res_partner res_partner_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: res_partner_title res_partner_title_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_title
    ADD CONSTRAINT res_partner_title_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_title_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_title_fkey FOREIGN KEY (title) REFERENCES public.res_partner_title(id) ON DELETE SET NULL;


--
-- Name: res_partner_title res_partner_title_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_title
    ADD CONSTRAINT res_partner_title_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: res_partner res_partner_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_apikeys_description res_users_apikeys_description_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_apikeys_description
    ADD CONSTRAINT res_users_apikeys_description_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_apikeys_description res_users_apikeys_description_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_apikeys_description
    ADD CONSTRAINT res_users_apikeys_description_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_apikeys res_users_apikeys_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_apikeys
    ADD CONSTRAINT res_users_apikeys_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id);


--
-- Name: res_users res_users_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: res_users res_users_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_deletion res_users_deletion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_deletion
    ADD CONSTRAINT res_users_deletion_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_deletion res_users_deletion_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_deletion
    ADD CONSTRAINT res_users_deletion_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_deletion res_users_deletion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_deletion
    ADD CONSTRAINT res_users_deletion_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_identitycheck res_users_identitycheck_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_identitycheck
    ADD CONSTRAINT res_users_identitycheck_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_identitycheck res_users_identitycheck_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_identitycheck
    ADD CONSTRAINT res_users_identitycheck_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_log res_users_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_log
    ADD CONSTRAINT res_users_log_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_log res_users_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_log
    ADD CONSTRAINT res_users_log_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_next_rank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_next_rank_id_fkey FOREIGN KEY (next_rank_id) REFERENCES public.gamification_karma_rank(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: res_users res_users_rank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_rank_id_fkey FOREIGN KEY (rank_id) REFERENCES public.gamification_karma_rank(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_sale_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_sale_team_id_fkey FOREIGN KEY (sale_team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: res_users_settings res_users_settings_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings
    ADD CONSTRAINT res_users_settings_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_settings res_users_settings_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings
    ADD CONSTRAINT res_users_settings_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_user_setting_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_user_setting_id_fkey FOREIGN KEY (user_setting_id) REFERENCES public.res_users_settings(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_settings res_users_settings_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings
    ADD CONSTRAINT res_users_settings_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_compare_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_compare_view_id_fkey FOREIGN KEY (compare_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE CASCADE;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar resource_calendar_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar
    ADD CONSTRAINT resource_calendar_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_calendar resource_calendar_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar
    ADD CONSTRAINT resource_calendar_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar resource_calendar_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar
    ADD CONSTRAINT resource_calendar_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE RESTRICT;


--
-- Name: resource_resource resource_resource_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rule_group_rel rule_group_rel_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rule_group_rel
    ADD CONSTRAINT rule_group_rel_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE RESTRICT;


--
-- Name: rule_group_rel rule_group_rel_rule_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rule_group_rel
    ADD CONSTRAINT rule_group_rel_rule_group_id_fkey FOREIGN KEY (rule_group_id) REFERENCES public.ir_rule(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_deposit_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_deposit_account_id_fkey FOREIGN KEY (deposit_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv_sale_order_rel sale_advance_payment_inv_sale__sale_advance_payment_inv_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv_sale_order_rel
    ADD CONSTRAINT sale_advance_payment_inv_sale__sale_advance_payment_inv_id_fkey FOREIGN KEY (sale_advance_payment_inv_id) REFERENCES public.sale_advance_payment_inv(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv_sale_order_rel sale_advance_payment_inv_sale_order_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv_sale_order_rel
    ADD CONSTRAINT sale_advance_payment_inv_sale_order_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_analytic_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_analytic_account_id_fkey FOREIGN KEY (analytic_account_id) REFERENCES public.account_analytic_account(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: sale_order_cancel sale_order_cancel_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_cancel
    ADD CONSTRAINT sale_order_cancel_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sale_order_cancel sale_order_cancel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_cancel
    ADD CONSTRAINT sale_order_cancel_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_cancel sale_order_cancel_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_cancel
    ADD CONSTRAINT sale_order_cancel_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_cancel sale_order_cancel_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_cancel
    ADD CONSTRAINT sale_order_cancel_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: sale_order_cancel sale_order_cancel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_cancel
    ADD CONSTRAINT sale_order_cancel_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_incoterm_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_incoterm_fkey FOREIGN KEY (incoterm) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: sale_order_line_invoice_rel sale_order_line_invoice_rel_invoice_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line_invoice_rel
    ADD CONSTRAINT sale_order_line_invoice_rel_invoice_line_id_fkey FOREIGN KEY (invoice_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line_invoice_rel sale_order_line_invoice_rel_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line_invoice_rel
    ADD CONSTRAINT sale_order_line_invoice_rel_order_line_id_fkey FOREIGN KEY (order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_order_partner_id_fkey FOREIGN KEY (order_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_product_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_packaging_id_fkey FOREIGN KEY (product_packaging_id) REFERENCES public.product_packaging(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_product_uom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_uom_fkey FOREIGN KEY (product_uom) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_salesman_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_salesman_id_fkey FOREIGN KEY (salesman_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_task_id_fkey FOREIGN KEY (task_id) REFERENCES public.project_task(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_opportunity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_opportunity_id_fkey FOREIGN KEY (opportunity_id) REFERENCES public.crm_lead(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_option sale_order_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_option sale_order_option_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_option sale_order_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_partner_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_invoice_id_fkey FOREIGN KEY (partner_invoice_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_partner_shipping_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_shipping_id_fkey FOREIGN KEY (partner_shipping_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_payment_term_id_fkey FOREIGN KEY (payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_procurement_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_procurement_group_id_fkey FOREIGN KEY (procurement_group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: sale_order_tag_rel sale_order_tag_rel_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_tag_rel
    ADD CONSTRAINT sale_order_tag_rel_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_tag_rel sale_order_tag_rel_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_tag_rel
    ADD CONSTRAINT sale_order_tag_rel_tag_id_fkey FOREIGN KEY (tag_id) REFERENCES public.crm_tag(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: sale_order_template_line sale_order_template_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_template_option sale_order_template_option_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: sale_order_template_option sale_order_template_option_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_template_option sale_order_template_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_transaction_rel sale_order_transaction_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_transaction_rel
    ADD CONSTRAINT sale_order_transaction_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_transaction_rel sale_order_transaction_rel_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_transaction_rel
    ADD CONSTRAINT sale_order_transaction_rel_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_payment_provider_onboarding_wizard sale_payment_provider_onboarding_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_payment_provider_onboarding_wizard
    ADD CONSTRAINT sale_payment_provider_onboarding_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_payment_provider_onboarding_wizard sale_payment_provider_onboarding_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_payment_provider_onboarding_wizard
    ADD CONSTRAINT sale_payment_provider_onboarding_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_composer sms_composer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_composer
    ADD CONSTRAINT sms_composer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_composer sms_composer_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_composer
    ADD CONSTRAINT sms_composer_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: sms_composer sms_composer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_composer
    ADD CONSTRAINT sms_composer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_resend sms_resend_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend
    ADD CONSTRAINT sms_resend_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_resend sms_resend_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend
    ADD CONSTRAINT sms_resend_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: sms_resend_recipient sms_resend_recipient_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend_recipient
    ADD CONSTRAINT sms_resend_recipient_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_resend_recipient sms_resend_recipient_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend_recipient
    ADD CONSTRAINT sms_resend_recipient_notification_id_fkey FOREIGN KEY (notification_id) REFERENCES public.mail_notification(id) ON DELETE CASCADE;


--
-- Name: sms_resend_recipient sms_resend_recipient_sms_resend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend_recipient
    ADD CONSTRAINT sms_resend_recipient_sms_resend_id_fkey FOREIGN KEY (sms_resend_id) REFERENCES public.sms_resend(id) ON DELETE RESTRICT;


--
-- Name: sms_resend_recipient sms_resend_recipient_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend_recipient
    ADD CONSTRAINT sms_resend_recipient_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_resend sms_resend_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend
    ADD CONSTRAINT sms_resend_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template sms_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template sms_template_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: sms_template_preview sms_template_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_preview
    ADD CONSTRAINT sms_template_preview_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template_preview sms_template_preview_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_preview
    ADD CONSTRAINT sms_template_preview_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE CASCADE;


--
-- Name: sms_template_preview sms_template_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_preview
    ADD CONSTRAINT sms_template_preview_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template_reset sms_template_reset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_reset
    ADD CONSTRAINT sms_template_reset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template_reset sms_template_reset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_reset
    ADD CONSTRAINT sms_template_reset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template sms_template_sidebar_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_sidebar_action_id_fkey FOREIGN KEY (sidebar_action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: sms_template_sms_template_reset_rel sms_template_sms_template_reset_rel_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_sms_template_reset_rel
    ADD CONSTRAINT sms_template_sms_template_reset_rel_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE CASCADE;


--
-- Name: sms_template_sms_template_reset_rel sms_template_sms_template_reset_rel_sms_template_reset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_sms_template_reset_rel
    ADD CONSTRAINT sms_template_sms_template_reset_rel_sms_template_reset_id_fkey FOREIGN KEY (sms_template_reset_id) REFERENCES public.sms_template_reset(id) ON DELETE CASCADE;


--
-- Name: sms_template sms_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_confirm_invoice snailmail_confirm_invoice_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_confirm_invoice
    ADD CONSTRAINT snailmail_confirm_invoice_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_confirm_invoice snailmail_confirm_invoice_invoice_send_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_confirm_invoice
    ADD CONSTRAINT snailmail_confirm_invoice_invoice_send_id_fkey FOREIGN KEY (invoice_send_id) REFERENCES public.account_invoice_send(id) ON DELETE SET NULL;


--
-- Name: snailmail_confirm_invoice snailmail_confirm_invoice_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_confirm_invoice
    ADD CONSTRAINT snailmail_confirm_invoice_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: snailmail_letter snailmail_letter_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: snailmail_letter snailmail_letter_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_format_error snailmail_letter_format_error_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_format_error
    ADD CONSTRAINT snailmail_letter_format_error_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_format_error snailmail_letter_format_error_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_format_error
    ADD CONSTRAINT snailmail_letter_format_error_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_format_error snailmail_letter_format_error_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_format_error
    ADD CONSTRAINT snailmail_letter_format_error_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_letter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_letter_id_fkey FOREIGN KEY (letter_id) REFERENCES public.snailmail_letter(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: snailmail_letter snailmail_letter_report_template_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_report_template_fkey FOREIGN KEY (report_template) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_dashboard_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_dashboard_group_id_fkey FOREIGN KEY (dashboard_group_id) REFERENCES public.spreadsheet_dashboard_group(id) ON DELETE RESTRICT;


--
-- Name: spreadsheet_dashboard_group spreadsheet_dashboard_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard_group
    ADD CONSTRAINT spreadsheet_dashboard_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard_group spreadsheet_dashboard_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard_group
    ADD CONSTRAINT spreadsheet_dashboard_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_assign_serial stock_assign_serial_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_assign_serial
    ADD CONSTRAINT stock_assign_serial_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_assign_serial stock_assign_serial_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_assign_serial
    ADD CONSTRAINT stock_assign_serial_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_assign_serial stock_assign_serial_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_assign_serial
    ADD CONSTRAINT stock_assign_serial_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation stock_backorder_confirmation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation
    ADD CONSTRAINT stock_backorder_confirmation_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_lin_backorder_confirmation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation_line
    ADD CONSTRAINT stock_backorder_confirmation_lin_backorder_confirmation_id_fkey FOREIGN KEY (backorder_confirmation_id) REFERENCES public.stock_backorder_confirmation(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation_line
    ADD CONSTRAINT stock_backorder_confirmation_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_line_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation_line
    ADD CONSTRAINT stock_backorder_confirmation_line_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation_line
    ADD CONSTRAINT stock_backorder_confirmation_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation stock_backorder_confirmation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation
    ADD CONSTRAINT stock_backorder_confirmation_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_change_product_qty stock_change_product_qty_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_change_product_qty
    ADD CONSTRAINT stock_change_product_qty_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_change_product_qty stock_change_product_qty_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_change_product_qty
    ADD CONSTRAINT stock_change_product_qty_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_change_product_qty stock_change_product_qty_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_change_product_qty
    ADD CONSTRAINT stock_change_product_qty_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: stock_change_product_qty stock_change_product_qty_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_change_product_qty
    ADD CONSTRAINT stock_change_product_qty_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_conflict_quant_rel stock_conflict_quant_rel_stock_inventory_conflict_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_conflict_quant_rel
    ADD CONSTRAINT stock_conflict_quant_rel_stock_inventory_conflict_id_fkey FOREIGN KEY (stock_inventory_conflict_id) REFERENCES public.stock_inventory_conflict(id) ON DELETE CASCADE;


--
-- Name: stock_conflict_quant_rel stock_conflict_quant_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_conflict_quant_rel
    ADD CONSTRAINT stock_conflict_quant_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_immediate_transfer stock_immediate_transfer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_immediate_transfer
    ADD CONSTRAINT stock_immediate_transfer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_immediate_transfer_line stock_immediate_transfer_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_immediate_transfer_line
    ADD CONSTRAINT stock_immediate_transfer_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_immediate_transfer_line stock_immediate_transfer_line_immediate_transfer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_immediate_transfer_line
    ADD CONSTRAINT stock_immediate_transfer_line_immediate_transfer_id_fkey FOREIGN KEY (immediate_transfer_id) REFERENCES public.stock_immediate_transfer(id) ON DELETE RESTRICT;


--
-- Name: stock_immediate_transfer_line stock_immediate_transfer_line_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_immediate_transfer_line
    ADD CONSTRAINT stock_immediate_transfer_line_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_immediate_transfer_line stock_immediate_transfer_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_immediate_transfer_line
    ADD CONSTRAINT stock_immediate_transfer_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_immediate_transfer stock_immediate_transfer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_immediate_transfer
    ADD CONSTRAINT stock_immediate_transfer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_inventory_adjustment_name_stock_quant_rel stock_inventory_adjustment_na_stock_inventory_adjustment_n_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_adjustment_name_stock_quant_rel
    ADD CONSTRAINT stock_inventory_adjustment_na_stock_inventory_adjustment_n_fkey FOREIGN KEY (stock_inventory_adjustment_name_id) REFERENCES public.stock_inventory_adjustment_name(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_adjustment_name stock_inventory_adjustment_name_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_adjustment_name
    ADD CONSTRAINT stock_inventory_adjustment_name_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_inventory_adjustment_name_stock_quant_rel stock_inventory_adjustment_name_stock_quant_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_adjustment_name_stock_quant_rel
    ADD CONSTRAINT stock_inventory_adjustment_name_stock_quant_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_adjustment_name stock_inventory_adjustment_name_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_adjustment_name
    ADD CONSTRAINT stock_inventory_adjustment_name_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_inventory_conflict stock_inventory_conflict_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_conflict
    ADD CONSTRAINT stock_inventory_conflict_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_inventory_conflict_stock_quant_rel stock_inventory_conflict_stock_quant_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_conflict_stock_quant_rel
    ADD CONSTRAINT stock_inventory_conflict_stock_quant_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_conflict_stock_quant_rel stock_inventory_conflict_stock_stock_inventory_conflict_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_conflict_stock_quant_rel
    ADD CONSTRAINT stock_inventory_conflict_stock_stock_inventory_conflict_id_fkey FOREIGN KEY (stock_inventory_conflict_id) REFERENCES public.stock_inventory_conflict(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_conflict stock_inventory_conflict_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_conflict
    ADD CONSTRAINT stock_inventory_conflict_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_inventory_warning stock_inventory_warning_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_warning
    ADD CONSTRAINT stock_inventory_warning_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_inventory_warning_stock_quant_rel stock_inventory_warning_stock_q_stock_inventory_warning_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_warning_stock_quant_rel
    ADD CONSTRAINT stock_inventory_warning_stock_q_stock_inventory_warning_id_fkey FOREIGN KEY (stock_inventory_warning_id) REFERENCES public.stock_inventory_warning(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_warning_stock_quant_rel stock_inventory_warning_stock_quant_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_warning_stock_quant_rel
    ADD CONSTRAINT stock_inventory_warning_stock_quant_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_warning stock_inventory_warning_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_warning
    ADD CONSTRAINT stock_inventory_warning_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_location stock_location_removal_strategy_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_removal_strategy_id_fkey FOREIGN KEY (removal_strategy_id) REFERENCES public.product_removal(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_valuation_in_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_valuation_in_account_id_fkey FOREIGN KEY (valuation_in_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_valuation_out_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_valuation_out_account_id_fkey FOREIGN KEY (valuation_out_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_lot stock_lot_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_lot stock_lot_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_lot stock_lot_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: stock_lot stock_lot_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_lot stock_lot_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: stock_lot stock_lot_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_analytic_account_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_analytic_account_line_id_fkey FOREIGN KEY (analytic_account_line_id) REFERENCES public.account_analytic_line(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_created_purchase_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_created_purchase_line_id_fkey FOREIGN KEY (created_purchase_line_id) REFERENCES public.purchase_order_line(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line_consume_rel stock_move_line_consume_rel_consume_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line_consume_rel
    ADD CONSTRAINT stock_move_line_consume_rel_consume_line_id_fkey FOREIGN KEY (consume_line_id) REFERENCES public.stock_move_line(id) ON DELETE CASCADE;


--
-- Name: stock_move_line_consume_rel stock_move_line_consume_rel_produce_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line_consume_rel
    ADD CONSTRAINT stock_move_line_consume_rel_produce_line_id_fkey FOREIGN KEY (produce_line_id) REFERENCES public.stock_move_line(id) ON DELETE CASCADE;


--
-- Name: stock_move_line stock_move_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_package_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_package_level_id_fkey FOREIGN KEY (package_level_id) REFERENCES public.stock_package_level(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_move_line stock_move_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_result_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_result_package_id_fkey FOREIGN KEY (result_package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move_move_rel stock_move_move_rel_move_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_move_rel
    ADD CONSTRAINT stock_move_move_rel_move_dest_id_fkey FOREIGN KEY (move_dest_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: stock_move_move_rel stock_move_move_rel_move_orig_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_move_rel
    ADD CONSTRAINT stock_move_move_rel_move_orig_id_fkey FOREIGN KEY (move_orig_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: stock_move stock_move_orderpoint_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_orderpoint_id_fkey FOREIGN KEY (orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_origin_returned_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_origin_returned_move_id_fkey FOREIGN KEY (origin_returned_move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_package_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_package_level_id_fkey FOREIGN KEY (package_level_id) REFERENCES public.stock_package_level(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_product_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_product_packaging_id_fkey FOREIGN KEY (product_packaging_id) REFERENCES public.product_packaging(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_product_uom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_product_uom_fkey FOREIGN KEY (product_uom) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_purchase_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_purchase_line_id_fkey FOREIGN KEY (purchase_line_id) REFERENCES public.purchase_order_line(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_restrict_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_restrict_partner_id_fkey FOREIGN KEY (restrict_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_rule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_rule_id_fkey FOREIGN KEY (rule_id) REFERENCES public.stock_rule(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_orderpoint_snooze stock_orderpoint_snooze_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_orderpoint_snooze
    ADD CONSTRAINT stock_orderpoint_snooze_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_orderpoint_snooze_stock_warehouse_orderpoint_rel stock_orderpoint_snooze_stock_stock_warehouse_orderpoint_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_orderpoint_snooze_stock_warehouse_orderpoint_rel
    ADD CONSTRAINT stock_orderpoint_snooze_stock_stock_warehouse_orderpoint_i_fkey FOREIGN KEY (stock_warehouse_orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE CASCADE;


--
-- Name: stock_orderpoint_snooze_stock_warehouse_orderpoint_rel stock_orderpoint_snooze_stock_w_stock_orderpoint_snooze_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_orderpoint_snooze_stock_warehouse_orderpoint_rel
    ADD CONSTRAINT stock_orderpoint_snooze_stock_w_stock_orderpoint_snooze_id_fkey FOREIGN KEY (stock_orderpoint_snooze_id) REFERENCES public.stock_orderpoint_snooze(id) ON DELETE CASCADE;


--
-- Name: stock_orderpoint_snooze stock_orderpoint_snooze_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_orderpoint_snooze
    ADD CONSTRAINT stock_orderpoint_snooze_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_package_destination stock_package_destination_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_destination
    ADD CONSTRAINT stock_package_destination_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_package_destination stock_package_destination_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_destination
    ADD CONSTRAINT stock_package_destination_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_package_destination stock_package_destination_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_destination
    ADD CONSTRAINT stock_package_destination_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_package_destination stock_package_destination_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_destination
    ADD CONSTRAINT stock_package_destination_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_package_level stock_package_level_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_package_level stock_package_level_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_package_level stock_package_level_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_package_level stock_package_level_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_package_level stock_package_level_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_package_level stock_package_level_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_package_type stock_package_type_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type
    ADD CONSTRAINT stock_package_type_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_package_type stock_package_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type
    ADD CONSTRAINT stock_package_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_package_type_stock_putaway_rule_rel stock_package_type_stock_putaway_rul_stock_package_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type_stock_putaway_rule_rel
    ADD CONSTRAINT stock_package_type_stock_putaway_rul_stock_package_type_id_fkey FOREIGN KEY (stock_package_type_id) REFERENCES public.stock_package_type(id) ON DELETE CASCADE;


--
-- Name: stock_package_type_stock_putaway_rule_rel stock_package_type_stock_putaway_rul_stock_putaway_rule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type_stock_putaway_rule_rel
    ADD CONSTRAINT stock_package_type_stock_putaway_rul_stock_putaway_rule_id_fkey FOREIGN KEY (stock_putaway_rule_id) REFERENCES public.stock_putaway_rule(id) ON DELETE CASCADE;


--
-- Name: stock_package_type stock_package_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type
    ADD CONSTRAINT stock_package_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_backorder_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_backorder_id_fkey FOREIGN KEY (backorder_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_picking_backorder_rel stock_picking_backorder_rel_stock_backorder_confirmation_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_backorder_rel
    ADD CONSTRAINT stock_picking_backorder_rel_stock_backorder_confirmation_i_fkey FOREIGN KEY (stock_backorder_confirmation_id) REFERENCES public.stock_backorder_confirmation(id) ON DELETE CASCADE;


--
-- Name: stock_picking_backorder_rel stock_picking_backorder_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_backorder_rel
    ADD CONSTRAINT stock_picking_backorder_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_picking stock_picking_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_picking stock_picking_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_picking stock_picking_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE RESTRICT;


--
-- Name: stock_picking stock_picking_sale_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_sale_id_fkey FOREIGN KEY (sale_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: stock_picking_sms_rel stock_picking_sms_rel_confirm_stock_sms_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_sms_rel
    ADD CONSTRAINT stock_picking_sms_rel_confirm_stock_sms_id_fkey FOREIGN KEY (confirm_stock_sms_id) REFERENCES public.confirm_stock_sms(id) ON DELETE CASCADE;


--
-- Name: stock_picking_sms_rel stock_picking_sms_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_sms_rel
    ADD CONSTRAINT stock_picking_sms_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_picking_transfer_rel stock_picking_transfer_rel_stock_immediate_transfer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_transfer_rel
    ADD CONSTRAINT stock_picking_transfer_rel_stock_immediate_transfer_id_fkey FOREIGN KEY (stock_immediate_transfer_id) REFERENCES public.stock_immediate_transfer(id) ON DELETE CASCADE;


--
-- Name: stock_picking_transfer_rel stock_picking_transfer_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_transfer_rel
    ADD CONSTRAINT stock_picking_transfer_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_picking_type stock_picking_type_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_picking_type stock_picking_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_default_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_location_dest_id_fkey FOREIGN KEY (default_location_dest_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_default_location_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_location_src_id_fkey FOREIGN KEY (default_location_src_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_return_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_return_picking_type_id_fkey FOREIGN KEY (return_picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_sequence_id_fkey FOREIGN KEY (sequence_id) REFERENCES public.ir_sequence(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_picking_type stock_picking_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_putaway_rule stock_putaway_rule_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_putaway_rule stock_putaway_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_putaway_rule stock_putaway_rule_location_in_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_location_in_id_fkey FOREIGN KEY (location_in_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_location_out_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_location_out_id_fkey FOREIGN KEY (location_out_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_quant stock_quant_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE RESTRICT;


--
-- Name: stock_quant stock_quant_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_quant_package stock_quant_package_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_package_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_package_type_id_fkey FOREIGN KEY (package_type_id) REFERENCES public.stock_package_type(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_quant_stock_request_count_rel stock_quant_stock_request_count_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_request_count_rel
    ADD CONSTRAINT stock_quant_stock_request_count_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_request_count_rel stock_quant_stock_request_count_rel_stock_request_count_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_request_count_rel
    ADD CONSTRAINT stock_quant_stock_request_count_rel_stock_request_count_id_fkey FOREIGN KEY (stock_request_count_id) REFERENCES public.stock_request_count(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_track_confirmation_rel stock_quant_stock_track_confir_stock_track_confirmation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_track_confirmation_rel
    ADD CONSTRAINT stock_quant_stock_track_confir_stock_track_confirmation_id_fkey FOREIGN KEY (stock_track_confirmation_id) REFERENCES public.stock_track_confirmation(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_track_confirmation_rel stock_quant_stock_track_confirmation_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_track_confirmation_rel
    ADD CONSTRAINT stock_quant_stock_track_confirmation_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_quant stock_quant_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quantity_history stock_quantity_history_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quantity_history
    ADD CONSTRAINT stock_quantity_history_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quantity_history stock_quantity_history_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quantity_history
    ADD CONSTRAINT stock_quantity_history_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_info stock_replenishment_info_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_info
    ADD CONSTRAINT stock_replenishment_info_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_info stock_replenishment_info_orderpoint_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_info
    ADD CONSTRAINT stock_replenishment_info_orderpoint_id_fkey FOREIGN KEY (orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_info stock_replenishment_info_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_info
    ADD CONSTRAINT stock_replenishment_info_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_replenishment_info_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_replenishment_info_id_fkey FOREIGN KEY (replenishment_info_id) REFERENCES public.stock_replenishment_info(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_request_count stock_request_count_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_request_count
    ADD CONSTRAINT stock_request_count_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_request_count stock_request_count_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_request_count
    ADD CONSTRAINT stock_request_count_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_request_count stock_request_count_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_request_count
    ADD CONSTRAINT stock_request_count_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking stock_return_picking_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking
    ADD CONSTRAINT stock_return_picking_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking_line stock_return_picking_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking_line stock_return_picking_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking_line stock_return_picking_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_return_picking_line stock_return_picking_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.stock_return_picking(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking_line stock_return_picking_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking stock_return_picking_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking
    ADD CONSTRAINT stock_return_picking_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking stock_return_picking_original_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking
    ADD CONSTRAINT stock_return_picking_original_location_id_fkey FOREIGN KEY (original_location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking stock_return_picking_parent_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking
    ADD CONSTRAINT stock_return_picking_parent_location_id_fkey FOREIGN KEY (parent_location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking stock_return_picking_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking
    ADD CONSTRAINT stock_return_picking_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking stock_return_picking_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking
    ADD CONSTRAINT stock_return_picking_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_route_categ stock_route_categ_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_categ
    ADD CONSTRAINT stock_route_categ_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: stock_route_categ stock_route_categ_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_categ
    ADD CONSTRAINT stock_route_categ_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route stock_route_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_route stock_route_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_route_move stock_route_move_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_move
    ADD CONSTRAINT stock_route_move_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: stock_route_move stock_route_move_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_move
    ADD CONSTRAINT stock_route_move_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_packaging stock_route_packaging_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_packaging
    ADD CONSTRAINT stock_route_packaging_packaging_id_fkey FOREIGN KEY (packaging_id) REFERENCES public.product_packaging(id) ON DELETE CASCADE;


--
-- Name: stock_route_packaging stock_route_packaging_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_packaging
    ADD CONSTRAINT stock_route_packaging_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_product stock_route_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_product
    ADD CONSTRAINT stock_route_product_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: stock_route_product stock_route_product_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_product
    ADD CONSTRAINT stock_route_product_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_stock_rules_report_rel stock_route_stock_rules_report_rel_stock_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_stock_rules_report_rel
    ADD CONSTRAINT stock_route_stock_rules_report_rel_stock_route_id_fkey FOREIGN KEY (stock_route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_stock_rules_report_rel stock_route_stock_rules_report_rel_stock_rules_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_stock_rules_report_rel
    ADD CONSTRAINT stock_route_stock_rules_report_rel_stock_rules_report_id_fkey FOREIGN KEY (stock_rules_report_id) REFERENCES public.stock_rules_report(id) ON DELETE CASCADE;


--
-- Name: stock_route stock_route_supplied_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_supplied_wh_id_fkey FOREIGN KEY (supplied_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_route stock_route_supplier_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_supplier_wh_id_fkey FOREIGN KEY (supplier_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_route_warehouse stock_route_warehouse_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_warehouse
    ADD CONSTRAINT stock_route_warehouse_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_warehouse stock_route_warehouse_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_warehouse
    ADD CONSTRAINT stock_route_warehouse_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_route stock_route_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_rule stock_rule_location_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_location_src_id_fkey FOREIGN KEY (location_src_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_partner_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_partner_address_id_fkey FOREIGN KEY (partner_address_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE RESTRICT;


--
-- Name: stock_rule stock_rule_propagate_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_propagate_warehouse_id_fkey FOREIGN KEY (propagate_warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_rule stock_rule_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_rules_report stock_rules_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report
    ADD CONSTRAINT stock_rules_report_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_rules_report stock_rules_report_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report
    ADD CONSTRAINT stock_rules_report_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report stock_rules_report_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report
    ADD CONSTRAINT stock_rules_report_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report_stock_warehouse_rel stock_rules_report_stock_warehouse_r_stock_rules_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report_stock_warehouse_rel
    ADD CONSTRAINT stock_rules_report_stock_warehouse_r_stock_rules_report_id_fkey FOREIGN KEY (stock_rules_report_id) REFERENCES public.stock_rules_report(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report_stock_warehouse_rel stock_rules_report_stock_warehouse_rel_stock_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report_stock_warehouse_rel
    ADD CONSTRAINT stock_rules_report_stock_warehouse_rel_stock_warehouse_id_fkey FOREIGN KEY (stock_warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report stock_rules_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report
    ADD CONSTRAINT stock_rules_report_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_scheduler_compute stock_scheduler_compute_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scheduler_compute
    ADD CONSTRAINT stock_scheduler_compute_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_scheduler_compute stock_scheduler_compute_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scheduler_compute
    ADD CONSTRAINT stock_scheduler_compute_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_scrap_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_scrap_location_id_fkey FOREIGN KEY (scrap_location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_package_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_package_type_id_fkey FOREIGN KEY (package_type_id) REFERENCES public.stock_package_type(id) ON DELETE CASCADE;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE CASCADE;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_storage_category stock_storage_category_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category
    ADD CONSTRAINT stock_storage_category_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_storage_category stock_storage_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category
    ADD CONSTRAINT stock_storage_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_storage_category stock_storage_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category
    ADD CONSTRAINT stock_storage_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_traceability_report stock_traceability_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_traceability_report
    ADD CONSTRAINT stock_traceability_report_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_traceability_report stock_traceability_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_traceability_report
    ADD CONSTRAINT stock_traceability_report_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_track_confirmation stock_track_confirmation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_confirmation
    ADD CONSTRAINT stock_track_confirmation_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_track_confirmation stock_track_confirmation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_confirmation
    ADD CONSTRAINT stock_track_confirmation_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_track_line stock_track_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_line
    ADD CONSTRAINT stock_track_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_track_line stock_track_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_line
    ADD CONSTRAINT stock_track_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: stock_track_line stock_track_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_line
    ADD CONSTRAINT stock_track_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.stock_track_confirmation(id) ON DELETE SET NULL;


--
-- Name: stock_track_line stock_track_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_line
    ADD CONSTRAINT stock_track_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_valuation_layer stock_valuation_layer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_stock_valuation_layer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_stock_valuation_layer_id_fkey FOREIGN KEY (stock_valuation_layer_id) REFERENCES public.stock_valuation_layer(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_buy_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_buy_pull_id_fkey FOREIGN KEY (buy_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_crossdock_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_crossdock_route_id_fkey FOREIGN KEY (crossdock_route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_delivery_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_delivery_route_id_fkey FOREIGN KEY (delivery_route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_in_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_in_type_id_fkey FOREIGN KEY (in_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_int_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_int_type_id_fkey FOREIGN KEY (int_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_lot_stock_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_lot_stock_id_fkey FOREIGN KEY (lot_stock_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_mto_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_mto_pull_id_fkey FOREIGN KEY (mto_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_product_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_product_category_id_fkey FOREIGN KEY (product_category_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_supplier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_supplier_id_fkey FOREIGN KEY (supplier_id) REFERENCES public.product_supplierinfo(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_vendor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_vendor_id_fkey FOREIGN KEY (vendor_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_out_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_out_type_id_fkey FOREIGN KEY (out_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_pack_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pack_type_id_fkey FOREIGN KEY (pack_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_pick_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pick_type_id_fkey FOREIGN KEY (pick_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_reception_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_reception_route_id_fkey FOREIGN KEY (reception_route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_return_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_return_type_id_fkey FOREIGN KEY (return_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_view_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_view_location_id_fkey FOREIGN KEY (view_location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_wh_input_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_input_stock_loc_id_fkey FOREIGN KEY (wh_input_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_wh_output_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_output_stock_loc_id_fkey FOREIGN KEY (wh_output_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_wh_pack_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_pack_stock_loc_id_fkey FOREIGN KEY (wh_pack_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_wh_qc_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_qc_stock_loc_id_fkey FOREIGN KEY (wh_qc_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_scrap_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_scrap_id_fkey FOREIGN KEY (scrap_id) REFERENCES public.stock_scrap(id) ON DELETE SET NULL;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_wh_resupply_table stock_wh_resupply_table_supplied_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_wh_resupply_table
    ADD CONSTRAINT stock_wh_resupply_table_supplied_wh_id_fkey FOREIGN KEY (supplied_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_wh_resupply_table stock_wh_resupply_table_supplier_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_wh_resupply_table
    ADD CONSTRAINT stock_wh_resupply_table_supplier_wh_id_fkey FOREIGN KEY (supplier_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: survey_invite survey_invite_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite
    ADD CONSTRAINT survey_invite_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: survey_invite survey_invite_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite
    ADD CONSTRAINT survey_invite_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_invite survey_invite_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite
    ADD CONSTRAINT survey_invite_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: survey_invite_partner_ids survey_invite_partner_ids_invite_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite_partner_ids
    ADD CONSTRAINT survey_invite_partner_ids_invite_id_fkey FOREIGN KEY (invite_id) REFERENCES public.survey_invite(id) ON DELETE CASCADE;


--
-- Name: survey_invite_partner_ids survey_invite_partner_ids_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite_partner_ids
    ADD CONSTRAINT survey_invite_partner_ids_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: survey_invite survey_invite_survey_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite
    ADD CONSTRAINT survey_invite_survey_id_fkey FOREIGN KEY (survey_id) REFERENCES public.survey_survey(id) ON DELETE CASCADE;


--
-- Name: survey_invite survey_invite_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite
    ADD CONSTRAINT survey_invite_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: survey_invite survey_invite_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_invite
    ADD CONSTRAINT survey_invite_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_mail_compose_message_ir_attachments_rel survey_mail_compose_message_ir_attachments_r_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_mail_compose_message_ir_attachments_rel
    ADD CONSTRAINT survey_mail_compose_message_ir_attachments_r_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: survey_mail_compose_message_ir_attachments_rel survey_mail_compose_message_ir_attachments_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_mail_compose_message_ir_attachments_rel
    ADD CONSTRAINT survey_mail_compose_message_ir_attachments_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.survey_invite(id) ON DELETE CASCADE;


--
-- Name: survey_question_answer survey_question_answer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question_answer
    ADD CONSTRAINT survey_question_answer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_question_answer survey_question_answer_matrix_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question_answer
    ADD CONSTRAINT survey_question_answer_matrix_question_id_fkey FOREIGN KEY (matrix_question_id) REFERENCES public.survey_question(id) ON DELETE CASCADE;


--
-- Name: survey_question_answer survey_question_answer_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question_answer
    ADD CONSTRAINT survey_question_answer_question_id_fkey FOREIGN KEY (question_id) REFERENCES public.survey_question(id) ON DELETE CASCADE;


--
-- Name: survey_question_answer survey_question_answer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question_answer
    ADD CONSTRAINT survey_question_answer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_question survey_question_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question
    ADD CONSTRAINT survey_question_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_question survey_question_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question
    ADD CONSTRAINT survey_question_page_id_fkey FOREIGN KEY (page_id) REFERENCES public.survey_question(id) ON DELETE SET NULL;


--
-- Name: survey_question survey_question_survey_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question
    ADD CONSTRAINT survey_question_survey_id_fkey FOREIGN KEY (survey_id) REFERENCES public.survey_survey(id) ON DELETE CASCADE;


--
-- Name: survey_question_survey_user_input_rel survey_question_survey_user_input_rel_survey_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question_survey_user_input_rel
    ADD CONSTRAINT survey_question_survey_user_input_rel_survey_question_id_fkey FOREIGN KEY (survey_question_id) REFERENCES public.survey_question(id) ON DELETE CASCADE;


--
-- Name: survey_question_survey_user_input_rel survey_question_survey_user_input_rel_survey_user_input_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question_survey_user_input_rel
    ADD CONSTRAINT survey_question_survey_user_input_rel_survey_user_input_id_fkey FOREIGN KEY (survey_user_input_id) REFERENCES public.survey_user_input(id) ON DELETE CASCADE;


--
-- Name: survey_question survey_question_triggering_answer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question
    ADD CONSTRAINT survey_question_triggering_answer_id_fkey FOREIGN KEY (triggering_answer_id) REFERENCES public.survey_question_answer(id) ON DELETE SET NULL;


--
-- Name: survey_question survey_question_triggering_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question
    ADD CONSTRAINT survey_question_triggering_question_id_fkey FOREIGN KEY (triggering_question_id) REFERENCES public.survey_question(id) ON DELETE SET NULL;


--
-- Name: survey_question survey_question_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_question
    ADD CONSTRAINT survey_question_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_survey survey_survey_certification_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_survey
    ADD CONSTRAINT survey_survey_certification_badge_id_fkey FOREIGN KEY (certification_badge_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


--
-- Name: survey_survey survey_survey_certification_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_survey
    ADD CONSTRAINT survey_survey_certification_mail_template_id_fkey FOREIGN KEY (certification_mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: survey_survey survey_survey_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_survey
    ADD CONSTRAINT survey_survey_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_survey survey_survey_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_survey
    ADD CONSTRAINT survey_survey_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: survey_survey survey_survey_session_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_survey
    ADD CONSTRAINT survey_survey_session_question_id_fkey FOREIGN KEY (session_question_id) REFERENCES public.survey_question(id) ON DELETE SET NULL;


--
-- Name: survey_survey survey_survey_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_survey
    ADD CONSTRAINT survey_survey_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_survey survey_survey_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_survey
    ADD CONSTRAINT survey_survey_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_user_input survey_user_input_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input
    ADD CONSTRAINT survey_user_input_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_user_input survey_user_input_last_displayed_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input
    ADD CONSTRAINT survey_user_input_last_displayed_page_id_fkey FOREIGN KEY (last_displayed_page_id) REFERENCES public.survey_question(id) ON DELETE SET NULL;


--
-- Name: survey_user_input_line survey_user_input_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input_line
    ADD CONSTRAINT survey_user_input_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_user_input_line survey_user_input_line_matrix_row_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input_line
    ADD CONSTRAINT survey_user_input_line_matrix_row_id_fkey FOREIGN KEY (matrix_row_id) REFERENCES public.survey_question_answer(id) ON DELETE SET NULL;


--
-- Name: survey_user_input_line survey_user_input_line_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input_line
    ADD CONSTRAINT survey_user_input_line_question_id_fkey FOREIGN KEY (question_id) REFERENCES public.survey_question(id) ON DELETE CASCADE;


--
-- Name: survey_user_input_line survey_user_input_line_suggested_answer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input_line
    ADD CONSTRAINT survey_user_input_line_suggested_answer_id_fkey FOREIGN KEY (suggested_answer_id) REFERENCES public.survey_question_answer(id) ON DELETE SET NULL;


--
-- Name: survey_user_input_line survey_user_input_line_survey_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input_line
    ADD CONSTRAINT survey_user_input_line_survey_id_fkey FOREIGN KEY (survey_id) REFERENCES public.survey_survey(id) ON DELETE SET NULL;


--
-- Name: survey_user_input_line survey_user_input_line_user_input_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input_line
    ADD CONSTRAINT survey_user_input_line_user_input_id_fkey FOREIGN KEY (user_input_id) REFERENCES public.survey_user_input(id) ON DELETE CASCADE;


--
-- Name: survey_user_input_line survey_user_input_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input_line
    ADD CONSTRAINT survey_user_input_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: survey_user_input survey_user_input_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input
    ADD CONSTRAINT survey_user_input_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: survey_user_input survey_user_input_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input
    ADD CONSTRAINT survey_user_input_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: survey_user_input survey_user_input_survey_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input
    ADD CONSTRAINT survey_user_input_survey_id_fkey FOREIGN KEY (survey_id) REFERENCES public.survey_survey(id) ON DELETE CASCADE;


--
-- Name: survey_user_input survey_user_input_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.survey_user_input
    ADD CONSTRAINT survey_user_input_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: task_dependencies_rel task_dependencies_rel_depends_on_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.task_dependencies_rel
    ADD CONSTRAINT task_dependencies_rel_depends_on_id_fkey FOREIGN KEY (depends_on_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: task_dependencies_rel task_dependencies_rel_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.task_dependencies_rel
    ADD CONSTRAINT task_dependencies_rel_task_id_fkey FOREIGN KEY (task_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: team_favorite_user_rel team_favorite_user_rel_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.team_favorite_user_rel
    ADD CONSTRAINT team_favorite_user_rel_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE CASCADE;


--
-- Name: team_favorite_user_rel team_favorite_user_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.team_favorite_user_rel
    ADD CONSTRAINT team_favorite_user_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: theme_ir_asset theme_ir_asset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_ir_asset
    ADD CONSTRAINT theme_ir_asset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_asset theme_ir_asset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_ir_asset
    ADD CONSTRAINT theme_ir_asset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_attachment theme_ir_attachment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_ir_attachment
    ADD CONSTRAINT theme_ir_attachment_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_attachment theme_ir_attachment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_ir_attachment
    ADD CONSTRAINT theme_ir_attachment_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_ui_view theme_ir_ui_view_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_ir_ui_view
    ADD CONSTRAINT theme_ir_ui_view_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_ui_view theme_ir_ui_view_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_ir_ui_view
    ADD CONSTRAINT theme_ir_ui_view_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_menu theme_website_menu_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_menu theme_website_menu_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_page_id_fkey FOREIGN KEY (page_id) REFERENCES public.theme_website_page(id) ON DELETE CASCADE;


--
-- Name: theme_website_menu theme_website_menu_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.theme_website_menu(id) ON DELETE CASCADE;


--
-- Name: theme_website_menu theme_website_menu_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_page theme_website_page_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_website_page
    ADD CONSTRAINT theme_website_page_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_page theme_website_page_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_website_page
    ADD CONSTRAINT theme_website_page_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.theme_ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: theme_website_page theme_website_page_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.theme_website_page
    ADD CONSTRAINT theme_website_page_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: uom_category uom_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.uom_category
    ADD CONSTRAINT uom_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: uom_category uom_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.uom_category
    ADD CONSTRAINT uom_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: uom_uom uom_uom_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.uom_uom
    ADD CONSTRAINT uom_uom_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.uom_category(id) ON DELETE RESTRICT;


--
-- Name: uom_uom uom_uom_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.uom_uom
    ADD CONSTRAINT uom_uom_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: uom_uom uom_uom_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.uom_uom
    ADD CONSTRAINT uom_uom_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_campaign utm_campaign_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: utm_campaign utm_campaign_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_campaign utm_campaign_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.utm_stage(id) ON DELETE RESTRICT;


--
-- Name: utm_campaign utm_campaign_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: utm_campaign utm_campaign_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_medium utm_medium_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_medium
    ADD CONSTRAINT utm_medium_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_medium utm_medium_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_medium
    ADD CONSTRAINT utm_medium_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_source utm_source_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_source
    ADD CONSTRAINT utm_source_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_source utm_source_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_source
    ADD CONSTRAINT utm_source_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_stage utm_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_stage
    ADD CONSTRAINT utm_stage_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_stage utm_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_stage
    ADD CONSTRAINT utm_stage_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_tag utm_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_tag
    ADD CONSTRAINT utm_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_tag_rel utm_tag_rel_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_tag_rel
    ADD CONSTRAINT utm_tag_rel_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_tag(id) ON DELETE CASCADE;


--
-- Name: utm_tag_rel utm_tag_rel_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_tag_rel
    ADD CONSTRAINT utm_tag_rel_tag_id_fkey FOREIGN KEY (tag_id) REFERENCES public.utm_campaign(id) ON DELETE CASCADE;


--
-- Name: utm_tag utm_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_tag
    ADD CONSTRAINT utm_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: validate_account_move validate_account_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.validate_account_move
    ADD CONSTRAINT validate_account_move_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: validate_account_move validate_account_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.validate_account_move
    ADD CONSTRAINT validate_account_move_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test web_editor_converter_test_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_editor_converter_test
    ADD CONSTRAINT web_editor_converter_test_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test web_editor_converter_test_many2one_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_editor_converter_test
    ADD CONSTRAINT web_editor_converter_test_many2one_fkey FOREIGN KEY (many2one) REFERENCES public.web_editor_converter_test_sub(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test_sub web_editor_converter_test_sub_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_editor_converter_test_sub
    ADD CONSTRAINT web_editor_converter_test_sub_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test_sub web_editor_converter_test_sub_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_editor_converter_test_sub
    ADD CONSTRAINT web_editor_converter_test_sub_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test web_editor_converter_test_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_editor_converter_test
    ADD CONSTRAINT web_editor_converter_test_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_tour_tour web_tour_tour_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_tour_tour
    ADD CONSTRAINT web_tour_tour_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.im_livechat_channel(id) ON DELETE SET NULL;


--
-- Name: website website_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: website_configurator_feature website_configurator_feature_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_configurator_feature website_configurator_feature_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: website_configurator_feature website_configurator_feature_page_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_page_view_id_fkey FOREIGN KEY (page_view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: website_configurator_feature website_configurator_feature_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_crm_default_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_crm_default_team_id_fkey FOREIGN KEY (crm_default_team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: website website_crm_default_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_crm_default_user_id_fkey FOREIGN KEY (crm_default_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_default_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_default_lang_id_fkey FOREIGN KEY (default_lang_id) REFERENCES public.res_lang(id) ON DELETE RESTRICT;


--
-- Name: website_lang_rel website_lang_rel_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_lang_rel
    ADD CONSTRAINT website_lang_rel_lang_id_fkey FOREIGN KEY (lang_id) REFERENCES public.res_lang(id) ON DELETE CASCADE;


--
-- Name: website_lang_rel website_lang_rel_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_lang_rel
    ADD CONSTRAINT website_lang_rel_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_menu website_menu_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_page_id_fkey FOREIGN KEY (page_id) REFERENCES public.website_page(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.website_menu(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_website_menu(id) ON DELETE SET NULL;


--
-- Name: website_menu website_menu_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page website_page_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page website_page_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_website_page(id) ON DELETE SET NULL;


--
-- Name: website_page website_page_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: website_page website_page_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_page website_page_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_rewrite website_rewrite_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_rewrite website_rewrite_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.website_route(id) ON DELETE SET NULL;


--
-- Name: website_rewrite website_rewrite_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_rewrite website_rewrite_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_robots website_robots_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_robots
    ADD CONSTRAINT website_robots_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_robots website_robots_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_robots
    ADD CONSTRAINT website_robots_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_route website_route_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_route
    ADD CONSTRAINT website_route_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_route website_route_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_route
    ADD CONSTRAINT website_route_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_snippet_filter website_snippet_filter_action_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_action_server_id_fkey FOREIGN KEY (action_server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: website_snippet_filter website_snippet_filter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_snippet_filter website_snippet_filter_filter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_filter_id_fkey FOREIGN KEY (filter_id) REFERENCES public.ir_filters(id) ON DELETE CASCADE;


--
-- Name: website_snippet_filter website_snippet_filter_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_snippet_filter website_snippet_filter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_theme_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_theme_id_fkey FOREIGN KEY (theme_id) REFERENCES public.ir_module_module(id) ON DELETE SET NULL;


--
-- Name: website_track website_track_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_track
    ADD CONSTRAINT website_track_page_id_fkey FOREIGN KEY (page_id) REFERENCES public.website_page(id) ON DELETE CASCADE;


--
-- Name: website_track website_track_visitor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_track
    ADD CONSTRAINT website_track_visitor_id_fkey FOREIGN KEY (visitor_id) REFERENCES public.website_visitor(id) ON DELETE CASCADE;


--
-- Name: website website_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: website_visitor website_visitor_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_lang_id_fkey FOREIGN KEY (lang_id) REFERENCES public.res_lang(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_livechat_operator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_livechat_operator_id_fkey FOREIGN KEY (livechat_operator_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.ir_ui_menu(id) ON DELETE CASCADE;


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
--

\unrestrict dbiXqOKlZv99RhNbU10wP9vIx0hYyUdISnYfbmKSs6TXSK6yarouxD4z0cg0FyD

