-- Name: stock_rule__location_dest_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__location_dest_id_index ON public.stock_rule USING btree (location_dest_id);


--
-- Name: stock_rule__location_src_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__location_src_id_index ON public.stock_rule USING btree (location_src_id);


--
-- Name: stock_rule__route_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__route_id_index ON public.stock_rule USING btree (route_id);


--
-- Name: stock_rule__warehouse_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__warehouse_id_index ON public.stock_rule USING btree (warehouse_id);


--
-- Name: stock_rules_report_stock_ware_stock_warehouse_id_stock_rule_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rules_report_stock_ware_stock_warehouse_id_stock_rule_idx ON public.stock_rules_report_stock_warehouse_rel USING btree (stock_warehouse_id, stock_rules_report_id);


--
-- Name: stock_scrap_stock_scrap_reaso_stock_scrap_reason_tag_id_sto_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_scrap_stock_scrap_reaso_stock_scrap_reason_tag_id_sto_idx ON public.stock_scrap_stock_scrap_reason_tag_rel USING btree (stock_scrap_reason_tag_id, stock_scrap_id);


--
-- Name: stock_storage_category_capacity__storage_category_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_storage_category_capacity__storage_category_id_index ON public.stock_storage_category_capacity USING btree (storage_category_id);


--
-- Name: stock_valuation_company_product_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_company_product_index ON public.stock_valuation_layer USING btree (product_id, company_id, id, value, quantity);


--
-- Name: stock_valuation_layer__account_move_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__account_move_id_index ON public.stock_valuation_layer USING btree (account_move_id) WHERE (account_move_id IS NOT NULL);


--
-- Name: stock_valuation_layer__account_move_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__account_move_line_id_index ON public.stock_valuation_layer USING btree (account_move_line_id) WHERE (account_move_line_id IS NOT NULL);


--
-- Name: stock_valuation_layer__lot_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__lot_id_index ON public.stock_valuation_layer USING btree (lot_id);


--
-- Name: stock_valuation_layer__stock_move_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__stock_move_id_index ON public.stock_valuation_layer USING btree (stock_move_id);


--
-- Name: stock_valuation_layer__stock_valuation_layer_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__stock_valuation_layer_id_index ON public.stock_valuation_layer USING btree (stock_valuation_layer_id);


--
-- Name: stock_valuation_layer_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer_index ON public.stock_valuation_layer USING btree (product_id, remaining_qty, stock_move_id, company_id, create_date);


--
-- Name: stock_valuation_layer_stock_v_stock_valuation_layer_id_stoc_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer_stock_v_stock_valuation_layer_id_stoc_idx ON public.stock_valuation_layer_stock_valuation_layer_revaluation_rel USING btree (stock_valuation_layer_id, stock_valuation_layer_revaluation_id);


--
-- Name: stock_warehouse_orderpoint__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_warehouse_orderpoint__company_id_index ON public.stock_warehouse_orderpoint USING btree (company_id);


--
-- Name: stock_warehouse_orderpoint__location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_warehouse_orderpoint__location_id_index ON public.stock_warehouse_orderpoint USING btree (location_id);


--
-- Name: stock_wh_resupply_table_supplier_wh_id_supplied_wh_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_wh_resupply_table_supplier_wh_id_supplied_wh_id_idx ON public.stock_wh_resupply_table USING btree (supplier_wh_id, supplied_wh_id);


--
-- Name: task_dependencies_rel_depends_on_id_task_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX task_dependencies_rel_depends_on_id_task_id_idx ON public.task_dependencies_rel USING btree (depends_on_id, task_id);


--
-- Name: team_favorite_user_rel_user_id_team_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX team_favorite_user_rel_user_id_team_id_idx ON public.team_favorite_user_rel USING btree (user_id, team_id);


--
-- Name: template_attribute_value_stoc_template_attribute_value_id_m_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX template_attribute_value_stoc_template_attribute_value_id_m_idx ON public.template_attribute_value_stock_move_rel USING btree (template_attribute_value_id, move_id);


--
-- Name: theme_website_menu__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX theme_website_menu__parent_id_index ON public.theme_website_menu USING btree (parent_id);


--
-- Name: unique_mail_message_id_res_partner_id_if_set; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX unique_mail_message_id_res_partner_id_if_set ON public.mail_notification USING btree (mail_message_id, res_partner_id) WHERE (res_partner_id IS NOT NULL);


--
-- Name: utm_tag_rel_campaign_id_tag_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX utm_tag_rel_campaign_id_tag_id_idx ON public.utm_tag_rel USING btree (campaign_id, tag_id);


--
-- Name: website_controller_page__is_published_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_controller_page__is_published_index ON public.website_controller_page USING btree (is_published);


--
-- Name: website_controller_page__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_controller_page__website_id_index ON public.website_controller_page USING btree (website_id);


--
-- Name: website_lang_rel_lang_id_website_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_lang_rel_lang_id_website_id_idx ON public.website_lang_rel USING btree (lang_id, website_id);


--
-- Name: website_menu__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_menu__parent_id_index ON public.website_menu USING btree (parent_id);


--
-- Name: website_menu__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_menu__parent_path_index ON public.website_menu USING btree (parent_path);


--
-- Name: website_page__is_published_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_page__is_published_index ON public.website_page USING btree (is_published);


--
-- Name: website_page__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_page__website_id_index ON public.website_page USING btree (website_id);


--
-- Name: website_rewrite__url_from_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_rewrite__url_from_index ON public.website_rewrite USING btree (url_from);


--
-- Name: website_rewrite__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_rewrite__website_id_index ON public.website_rewrite USING btree (website_id);


--
-- Name: website_snippet_filter__is_published_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_snippet_filter__is_published_index ON public.website_snippet_filter USING btree (is_published);


--
-- Name: website_snippet_filter__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_snippet_filter__website_id_index ON public.website_snippet_filter USING btree (website_id);


--
-- Name: website_track__page_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_track__page_id_index ON public.website_track USING btree (page_id);


--
-- Name: website_track__url_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_track__url_index ON public.website_track USING btree (url);


--
-- Name: website_track__visitor_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_track__visitor_id_index ON public.website_track USING btree (visitor_id);


--
-- Name: website_visitor__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_visitor__partner_id_index ON public.website_visitor USING btree (partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: report_project_task_user _RETURN; Type: RULE; Schema: public; Owner: odoo
--

CREATE OR REPLACE VIEW public.report_project_task_user AS
 SELECT ( SELECT 1) AS nbr,
    t.id,
    t.id AS task_id,
    t.active,
    t.create_date,
    t.date_assign,
    t.date_end,
    t.date_last_stage_update,
    t.date_deadline,
    t.project_id,
    t.priority,
    t.name,
    t.company_id,
    t.partner_id,
    t.parent_id,
    t.stage_id,
    t.state,
    t.milestone_id,
        CASE
            WHEN ((t.state)::text = ANY (ARRAY[('1_done'::character varying)::text, ('1_canceled'::character varying)::text])) THEN true
            ELSE false
        END AS is_closed,
        CASE
            WHEN (pm.id IS NOT NULL) THEN true
            ELSE false
        END AS has_late_and_unreached_milestone,
    t.description,
    NULLIF(t.rating_last_value, (0)::double precision) AS rating_last_value,
    avg(rt.rating) AS rating_avg,
    NULLIF(t.working_days_close, (0)::double precision) AS working_days_close,
    NULLIF(t.working_days_open, (0)::double precision) AS working_days_open,
    NULLIF(t.working_hours_open, (0)::numeric) AS working_hours_open,
    NULLIF(t.working_hours_close, (0)::numeric) AS working_hours_close,
    (EXTRACT(epoch FROM (t.date_deadline - (now() AT TIME ZONE 'UTC'::text))) / ((3600 * 24))::numeric) AS delay_endings_days,
    count(td.task_id) AS dependent_ids_count,
    t.sale_line_id,
    t.sale_order_id,
        CASE
            WHEN (COALESCE(t.allocated_hours, (0)::double precision) = (0)::double precision) THEN (0.0)::double precision
            ELSE ((t.effective_hours * (100)::double precision) / t.allocated_hours)
        END AS progress,
    t.effective_hours,
        CASE
            WHEN (COALESCE(t.allocated_hours, (0)::double precision) = (0)::double precision) THEN (0.0)::double precision
            ELSE (t.allocated_hours - t.effective_hours)
        END AS remaining_hours,
        CASE
            WHEN (t.allocated_hours > (0)::double precision) THEN (t.remaining_hours / t.allocated_hours)
            ELSE (0)::double precision
        END AS remaining_hours_percentage,
    COALESCE(t.allocated_hours, (0)::double precision) AS allocated_hours,
    t.overtime,
    t.total_hours_spent,
    t.subtask_effective_hours,
    sol.remaining_hours AS remaining_hours_so
   FROM ((((public.project_task t
     LEFT JOIN public.rating_rating rt ON (((rt.res_id = t.id) AND ((rt.res_model)::text = 'project.task'::text) AND (rt.consumed = true) AND (rt.rating >= (1)::double precision))))
     LEFT JOIN public.project_milestone pm ON (((pm.id = t.milestone_id) AND (pm.is_reached = false) AND (pm.deadline <= (now())::date))))
     LEFT JOIN public.task_dependencies_rel td ON ((td.depends_on_id = t.id)))
     LEFT JOIN public.sale_order_line sol ON ((t.sale_line_id = sol.id)))
  WHERE (t.project_id IS NOT NULL)
  GROUP BY t.id, t.active, t.create_date, t.date_assign, t.date_end, t.date_last_stage_update, t.date_deadline, t.project_id, t.priority, t.name, t.company_id, t.partner_id, t.parent_id, t.stage_id, t.state, t.rating_last_value, t.working_days_close, t.working_days_open, t.working_hours_open, t.working_hours_close, t.milestone_id, pm.id, td.depends_on_id, t.sale_line_id, t.sale_order_id, t.effective_hours, t.subtask_effective_hours, t.allocated_hours, t.overtime, t.total_hours_spent, sol.remaining_hours;


--
-- Name: vendor_delay_report _RETURN; Type: RULE; Schema: public; Owner: odoo
--

CREATE OR REPLACE VIEW public.vendor_delay_report AS
 SELECT pol.id,
    min(m.date) AS date,
    pol.id AS purchase_line_id,
    pol.product_id,
    min(pc.id) AS category_id,
    pol.partner_id,
    pol.product_uom_qty AS qty_total,
    sum(
        CASE
            WHEN (((m.state)::text = 'done'::text) AND ((pol.date_planned)::date >= (m.date)::date)) THEN ((ml.quantity / ml_uom.factor) * pt_uom.factor)
            ELSE (0)::numeric
        END) AS qty_on_time
   FROM (((((((public.stock_move m
     JOIN public.purchase_order_line pol ON ((pol.id = m.purchase_line_id)))
     JOIN public.product_product p ON ((p.id = m.product_id)))
     JOIN public.product_template pt ON ((pt.id = p.product_tmpl_id)))
     JOIN public.uom_uom pt_uom ON ((pt_uom.id = pt.uom_id)))
     JOIN public.product_category pc ON ((pc.id = pt.categ_id)))
     LEFT JOIN public.stock_move_line ml ON ((ml.move_id = m.id)))
     LEFT JOIN public.uom_uom ml_uom ON ((ml_uom.id = ml.product_uom_id)))
  GROUP BY pol.id;


--
-- Name: account_account_account_journal_rel account_account_account_journal_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_journal_rel
    ADD CONSTRAINT account_account_account_journal_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_journal_rel account_account_account_journal_rel_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_journal_rel
    ADD CONSTRAINT account_account_account_journal_rel_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wiza_account_merge_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wiza_account_merge_wizard_id_fkey FOREIGN KEY (account_merge_wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wizard_re_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wizard_re_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account account_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account account_account_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_res_company_rel account_account_res_company_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_res_company_rel
    ADD CONSTRAINT account_account_res_company_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_res_company_rel account_account_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_li_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_li_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_line_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_line_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_t_account_tax_repartition_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_t_account_tax_repartition_line_fkey FOREIGN KEY (account_tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_tax_rep_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_tax_rep_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag account_account_tag_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tag account_account_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_templat_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_product_template_rel
    ADD CONSTRAINT account_account_tag_product_templat_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_template_r_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_product_template_rel
    ADD CONSTRAINT account_account_tag_product_template_r_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: account_account_tag account_account_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tax_default_rel
    ADD CONSTRAINT account_account_tax_default_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_account account_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_account account_analytic_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_account account_analytic_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_account account_analytic_account_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_account account_analytic_account_root_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_root_plan_id_fkey FOREIGN KEY (root_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_analytic_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_analytic_plan_id_fkey FOREIGN KEY (analytic_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_partner_category_id_fkey FOREIGN KEY (partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_analytic_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_general_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_general_account_id_fkey FOREIGN KEY (general_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_manager_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_move_line_id_fkey FOREIGN KEY (move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line account_analytic_line_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_parent_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_parent_task_id_fkey FOREIGN KEY (parent_task_id) REFERENCES public.project_task(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_so_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_so_line_fkey FOREIGN KEY (so_line) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line_stock_move_rel account_analytic_line_stock_move__account_analytic_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line_stock_move_rel
    ADD CONSTRAINT account_analytic_line_stock_move__account_analytic_line_id_fkey FOREIGN KEY (account_analytic_line_id) REFERENCES public.account_analytic_line(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line_stock_move_rel account_analytic_line_stock_move_rel_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line_stock_move_rel
    ADD CONSTRAINT account_analytic_line_stock_move_rel_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line account_analytic_line_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_task_id_fkey FOREIGN KEY (task_id) REFERENCES public.project_task(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_timesheet_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_timesheet_invoice_id_fkey FOREIGN KEY (timesheet_invoice_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_plan account_analytic_plan_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_plan account_analytic_plan_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_plan
    ADD CONSTRAINT account_analytic_plan_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_analytic_plan(id) ON DELETE CASCADE;


--
-- Name: account_analytic_plan account_analytic_plan_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizar_account_automatic_entry_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizar_account_automatic_entry_wiza_fkey FOREIGN KEY (account_automatic_entry_wizard_id) REFERENCES public.account_automatic_entry_wizard(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizard_accoun_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizard_accoun_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard
    ADD CONSTRAINT account_automatic_entry_wizard_destination_account_id_fkey FOREIGN KEY (destination_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_autopost_bills_wizard
    ADD CONSTRAINT account_autopost_bills_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement account_bank_statement_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement account_bank_statement_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attach_account_bank_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_ir_attachment_rel
    ADD CONSTRAINT account_bank_statement_ir_attach_account_bank_statement_id_fkey FOREIGN KEY (account_bank_statement_id) REFERENCES public.account_bank_statement(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attachment_rel_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_ir_attachment_rel
    ADD CONSTRAINT account_bank_statement_ir_attachment_rel_ir_attachment_id_fkey FOREIGN KEY (ir_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement account_bank_statement_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_foreign_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_foreign_currency_id_fkey FOREIGN KEY (foreign_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement_line account_bank_statement_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_bank_statement_line account_bank_statement_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement account_bank_statement_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_cash_rounding account_cash_rounding_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_cash_rounding account_cash_rounding_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_private_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_proxy_client_user
    ADD CONSTRAINT account_edi_proxy_client_user_private_key_id_fkey FOREIGN KEY (private_key_id) REFERENCES public.certificate_key(id) ON DELETE RESTRICT;


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_financial_year_op account_financial_year_op_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_financial_year_op account_financial_year_op_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_financial_year_op account_financial_year_op_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_dest_id_fkey FOREIGN KEY (account_dest_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_src_id_fkey FOREIGN KEY (account_src_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_country_group_id_fkey FOREIGN KEY (country_group_id) REFERENCES public.res_country_group(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position account_fiscal_position_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_cou_account_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_res_cou_account_fiscal_position_id_fkey FOREIGN KEY (account_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_country_s_res_country_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_res_country_s_res_country_state_id_fkey FOREIGN KEY (res_country_state_id) REFERENCES public.res_country_state(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_tax_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_tax_dest_id_fkey FOREIGN KEY (tax_dest_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_tax_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_tax_src_id_fkey FOREIGN KEY (tax_src_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_full_reconcile account_full_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_full_reconcile account_full_reconcile_exchange_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_full_reconcile
    ADD CONSTRAINT account_full_reconcile_exchange_move_id_fkey FOREIGN KEY (exchange_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_full_reconcile account_full_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_group account_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_group account_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_group account_group_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group
    ADD CONSTRAINT account_group_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_group(id) ON DELETE CASCADE;


--
-- Name: account_group account_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_incoterms account_incoterms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_incoterms account_incoterms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_g_account_journal_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_journal_group_rel
    ADD CONSTRAINT account_journal_account_journal_g_account_journal_group_id_fkey FOREIGN KEY (account_journal_group_id) REFERENCES public.account_journal_group(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_group_r_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_journal_group_rel
    ADD CONSTRAINT account_journal_account_journal_group_r_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconci_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_rel
    ADD CONSTRAINT account_journal_account_reconci_account_reconcile_model_id_fkey FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconcile_model_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_rel
    ADD CONSTRAINT account_journal_account_reconcile_model_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_journal account_journal_alias_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_alias_id_fkey FOREIGN KEY (alias_id) REFERENCES public.mail_alias(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_bank_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_bank_account_id_fkey FOREIGN KEY (bank_account_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal account_journal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal account_journal_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal account_journal_default_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_default_account_id_fkey FOREIGN KEY (default_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_journal_group account_journal_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal_group account_journal_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal_group account_journal_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal account_journal_loss_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_loss_account_id_fkey FOREIGN KEY (loss_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_profit_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_profit_account_id_fkey FOREIGN KEY (profit_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_suspense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_suspense_account_id_fkey FOREIGN KEY (suspense_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_lock_exception account_lock_exception_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_lock_exception account_lock_exception_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_lock_exception account_lock_exception_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_lock_exception account_lock_exception_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard account_merge_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard account_merge_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move__account_payment account_move__account_payment_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move__account_payment account_move__account_payment_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_sen_account_move_send_batch_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_move_send_batch_wizard_rel
    ADD CONSTRAINT account_move_account_move_sen_account_move_send_batch_wiza_fkey FOREIGN KEY (account_move_send_batch_wizard_id) REFERENCES public.account_move_send_batch_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_send_batch_wizar_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_move_send_batch_wizard_rel
    ADD CONSTRAINT account_move_account_move_send_batch_wizar_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_account_peppol_rejection_wizard_rel account_move_account_peppol_r_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_peppol_rejection_wizard_rel
    ADD CONSTRAINT account_move_account_peppol_r_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_peppol_rejection_wizard_rel account_move_account_peppol_rejection_wiza_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_peppol_rejection_wizard_rel
    ADD CONSTRAINT account_move_account_peppol_rejection_wiza_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequen_account_resequence_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_resequence_wizard_rel
    ADD CONSTRAINT account_move_account_resequen_account_resequence_wizard_id_fkey FOREIGN KEY (account_resequence_wizard_id) REFERENCES public.account_resequence_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequence_wizard_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_resequence_wizard_rel
    ADD CONSTRAINT account_move_account_resequence_wizard_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_auto_post_origin_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_auto_post_origin_id_fkey FOREIGN KEY (auto_post_origin_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_commercial_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_commercial_partner_id_fkey FOREIGN KEY (commercial_partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_invoice_cash_rounding_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_cash_rounding_id_fkey FOREIGN KEY (invoice_cash_rounding_id) REFERENCES public.account_cash_rounding(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_incoterm_id_fkey FOREIGN KEY (invoice_incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_payment_term_id_fkey FOREIGN KEY (invoice_payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_user_id_fkey FOREIGN KEY (invoice_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line_account_tax_rel
    ADD CONSTRAINT account_move_line_account_tax_rel_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line_account_tax_rel
    ADD CONSTRAINT account_move_line_account_tax_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_move_line account_move_line_cogs_origin_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_cogs_origin_id_fkey FOREIGN KEY (cogs_origin_id) REFERENCES public.account_move_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_company_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_company_currency_id_fkey FOREIGN KEY (company_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_full_reconcile_id_fkey FOREIGN KEY (full_reconcile_id) REFERENCES public.account_full_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_group_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_group_tax_id_fkey FOREIGN KEY (group_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_line account_move_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_purchase_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_purchase_line_id_fkey FOREIGN KEY (purchase_line_id) REFERENCES public.purchase_order_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_reconcile_model_id_fkey FOREIGN KEY (reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_statement_line_id_fkey FOREIGN KEY (statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_tax_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_group_id_fkey FOREIGN KEY (tax_group_id) REFERENCES public.account_tax_group(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_tax_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_line_id_fkey FOREIGN KEY (tax_line_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_tax_repartition_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_repartition_line_id_fkey FOREIGN KEY (tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_origin_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_origin_payment_id_fkey FOREIGN KEY (origin_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_partner_shipping_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_shipping_id_fkey FOREIGN KEY (partner_shipping_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_preferred_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_preferred_payment_method_line_id_fkey FOREIGN KEY (preferred_payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_move_purchase_order_rel account_move_purchase_order_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_purchase_order_rel
    ADD CONSTRAINT account_move_purchase_order_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_purchase_order_rel account_move_purchase_order_rel_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_purchase_order_rel
    ADD CONSTRAINT account_move_purchase_order_rel_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_reversal account_move_reversal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_reversal account_move_reversal_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_reversal_move account_move_reversal_move_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_move
    ADD CONSTRAINT account_move_reversal_move_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_move account_move_reversal_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_move
    ADD CONSTRAINT account_move_reversal_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_new_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_new_move_id_fkey FOREIGN KEY (new_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_reversed_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_reversed_entry_id_fkey FOREIGN KEY (reversed_entry_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_wizard account_move_send_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_wizard account_move_send_wizard_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard account_move_send_wizard_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard account_move_send_wizard_pdf_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_pdf_report_id_fkey FOREIGN KEY (pdf_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_p_account_move_send_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard_res_partner_rel
    ADD CONSTRAINT account_move_send_wizard_res_p_account_move_send_wizard_id_fkey FOREIGN KEY (account_move_send_wizard_id) REFERENCES public.account_move_send_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_wizard account_move_send_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_statement_line_id_fkey FOREIGN KEY (statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_origin_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_origin_move_id_fkey FOREIGN KEY (tax_cash_basis_origin_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_rec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_rec_id_fkey FOREIGN KEY (tax_cash_basis_rec_id) REFERENCES public.account_partial_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_mov_validate_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_mov_validate_account_move_id_fkey FOREIGN KEY (validate_account_move_id) REFERENCES public.validate_account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_move_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_move_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_partial_reconcile account_partial_reconcile_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_partial_reconcile account_partial_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_currency_id_fkey FOREIGN KEY (credit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_move_id_fkey FOREIGN KEY (credit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_currency_id_fkey FOREIGN KEY (debit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_move_id_fkey FOREIGN KEY (debit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_exchange_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_exchange_move_id_fkey FOREIGN KEY (exchange_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_full_reconcile_id_fkey FOREIGN KEY (full_reconcile_id) REFERENCES public.account_full_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank__account_bank_statement_line__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank__account_bank_statement_line__fkey FOREIGN KEY (account_bank_statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank_statement__account_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank_statement__account_payment_id_fkey FOREIGN KEY (account_payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_payment account_payment_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_destination_account_id_fkey FOREIGN KEY (destination_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method account_payment_method_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method_line account_payment_method_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method_line account_payment_method_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method_line account_payment_method_line_payment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_account_id_fkey FOREIGN KEY (payment_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_provider_id_fkey FOREIGN KEY (payment_provider_id) REFERENCES public.payment_provider(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method account_payment_method_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_outstanding_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_outstanding_account_id_fkey FOREIGN KEY (outstanding_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_paired_internal_transfer_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_paired_internal_transfer_payment_id_fkey FOREIGN KEY (paired_internal_transfer_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_transaction_id_fkey FOREIGN KEY (payment_transaction_id) REFERENCES public.payment_transaction(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register account_payment_register_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register account_payment_register_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register account_payment_register_custom_user_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_custom_user_currency_id_fkey FOREIGN KEY (custom_user_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_payment_register(id) ON DELETE CASCADE;


--
-- Name: account_payment_register account_payment_register_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment_register account_payment_register_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_source_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_source_currency_id_fkey FOREIGN KEY (source_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register account_payment_register_writeoff_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_writeoff_account_id_fkey FOREIGN KEY (writeoff_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_source_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_source_payment_id_fkey FOREIGN KEY (source_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_term account_payment_term_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_term_line account_payment_term_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_term_line account_payment_term_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment_term(id) ON DELETE CASCADE;


--
-- Name: account_payment_term_line account_payment_term_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_term account_payment_term_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_clarification account_peppol_clarification_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_clarification account_peppol_clarification_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_rejection_action_rel account_peppol_rejection_acti_account_peppol_clarification_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_action_rel
    ADD CONSTRAINT account_peppol_rejection_acti_account_peppol_clarification_fkey FOREIGN KEY (account_peppol_clarification_id) REFERENCES public.account_peppol_clarification(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_action_rel account_peppol_rejection_acti_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_action_rel
    ADD CONSTRAINT account_peppol_rejection_acti_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_reason_rel account_peppol_rejection_reas_account_peppol_clarification_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_reason_rel
    ADD CONSTRAINT account_peppol_rejection_reas_account_peppol_clarification_fkey FOREIGN KEY (account_peppol_clarification_id) REFERENCES public.account_peppol_clarification(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_reason_rel account_peppol_rejection_reas_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_reason_rel
    ADD CONSTRAINT account_peppol_rejection_reas_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_wizard account_peppol_rejection_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_rejection_wizard account_peppol_rejection_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_response account_peppol_response_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_response account_peppol_response_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_response
    ADD CONSTRAINT account_peppol_response_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_peppol_response account_peppol_response_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service account_peppol_service_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_edi_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service_wizard
    ADD CONSTRAINT account_peppol_service_wizard_edi_user_id_fkey FOREIGN KEY (edi_user_id) REFERENCES public.account_edi_proxy_client_user(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service account_peppol_service_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service
    ADD CONSTRAINT account_peppol_service_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_peppol_service_wizard(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service account_peppol_service_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model account_reconcile_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model account_reconcile_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line__account_reconcile_model_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line__account_reconcile_model_line_fkey FOREIGN KEY (account_reconcile_model_line_id) REFERENCES public.account_reconcile_model_line(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line_account_tax_re_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line_account_tax_re_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_line account_reconcile_model_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_line account_reconcile_model_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_line account_reconcile_model_line_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_partner_mapping
    ADD CONSTRAINT account_reconcile_model_partner_mapping_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_res_partner_category_rel account_reconcile_model_res_pa_account_reconcile_model_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_pa_account_reconcile_model_id_fkey1 FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_par_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_rel
    ADD CONSTRAINT account_reconcile_model_res_par_account_reconcile_model_id_fkey FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_category_rel account_reconcile_model_res_partne_res_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_partne_res_partner_category_id_fkey FOREIGN KEY (res_partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model account_reconcile_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_column account_report_column_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_column account_report_column_custom_audit_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_custom_audit_action_id_fkey FOREIGN KEY (custom_audit_action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report account_report_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report account_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_expression account_report_expression_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_expression account_report_expression_report_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_report_line_id_fkey FOREIGN KEY (report_line_id) REFERENCES public.account_report_line(id) ON DELETE CASCADE;


--
-- Name: account_report_expression account_report_expression_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_external_value account_report_external_value_carryover_origin_report_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_carryover_origin_report_line_fkey FOREIGN KEY (carryover_origin_report_line_id) REFERENCES public.account_report_line(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_external_value account_report_external_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_external_value account_report_external_value_foreign_vat_fiscal_position__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_foreign_vat_fiscal_position__fkey FOREIGN KEY (foreign_vat_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_target_report_expression_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_target_report_expression_id_fkey FOREIGN KEY (target_report_expression_id) REFERENCES public.account_report_expression(id) ON DELETE CASCADE;


--
-- Name: account_report_external_value account_report_external_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_line account_report_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_line account_report_line_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_line account_report_line_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_line account_report_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report account_report_root_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_root_report_id_fkey FOREIGN KEY (root_report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_section_rel account_report_section_rel_main_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_main_report_id_fkey FOREIGN KEY (main_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_section_rel account_report_section_rel_sub_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_sub_report_id_fkey FOREIGN KEY (sub_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report account_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_resequence_wizard account_resequence_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_resequence_wizard account_resequence_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_res_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_setup_bank_manual_config
    ADD CONSTRAINT account_setup_bank_manual_config_res_partner_bank_id_fkey FOREIGN KEY (res_partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE CASCADE;


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax account_tax_cash_basis_transition_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_cash_basis_transition_account_id_fkey FOREIGN KEY (cash_basis_transition_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax account_tax_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax account_tax_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: account_tax account_tax_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_filiation_rel account_tax_filiation_rel_child_tax_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_filiation_rel
    ADD CONSTRAINT account_tax_filiation_rel_child_tax_fkey FOREIGN KEY (child_tax) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_filiation_rel account_tax_filiation_rel_parent_tax_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_filiation_rel
    ADD CONSTRAINT account_tax_filiation_rel_parent_tax_fkey FOREIGN KEY (parent_tax) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_group account_tax_group_advance_tax_payment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_advance_tax_payment_account_id_fkey FOREIGN KEY (advance_tax_payment_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_group account_tax_group_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_group account_tax_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_group account_tax_group_tax_payable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_tax_payable_account_id_fkey FOREIGN KEY (tax_payable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_tax_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_tax_receivable_account_id_fkey FOREIGN KEY (tax_receivable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_purchase_order_line_rel account_tax_purchase_order_line_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_purchase_order_line_rel
    ADD CONSTRAINT account_tax_purchase_order_line_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_purchase_order_line_rel account_tax_purchase_order_line_rel_purchase_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_purchase_order_line_rel
    ADD CONSTRAINT account_tax_purchase_order_line_rel_purchase_order_line_id_fkey FOREIGN KEY (purchase_order_line_id) REFERENCES public.purchase_order_line(id) ON DELETE CASCADE;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_repartition_line account_tax_repartition_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_repartition_line account_tax_repartition_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_repartition_line account_tax_repartition_line_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_sale_order_discount_rel account_tax_sale_order_discount_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_discount_rel
    ADD CONSTRAINT account_tax_sale_order_discount_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_sale_order_discount_rel account_tax_sale_order_discount_rel_sale_order_discount_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_discount_rel
    ADD CONSTRAINT account_tax_sale_order_discount_rel_sale_order_discount_id_fkey FOREIGN KEY (sale_order_discount_id) REFERENCES public.sale_order_discount(id) ON DELETE CASCADE;


--
-- Name: account_tax_sale_order_line_rel account_tax_sale_order_line_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_line_rel
    ADD CONSTRAINT account_tax_sale_order_line_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_sale_order_line_rel account_tax_sale_order_line_rel_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_line_rel
    ADD CONSTRAINT account_tax_sale_order_line_rel_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: account_tax account_tax_tax_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_tax_group_id_fkey FOREIGN KEY (tax_group_id) REFERENCES public.account_tax_group(id) ON DELETE RESTRICT;


--
-- Name: account_tax account_tax_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: activity_attachment_rel activity_attachment_rel_activity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.activity_attachment_rel
    ADD CONSTRAINT activity_attachment_rel_activity_id_fkey FOREIGN KEY (activity_id) REFERENCES public.mail_activity(id) ON DELETE CASCADE;


--
-- Name: activity_attachment_rel activity_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: auth_totp_device auth_totp_device_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: auth_totp_wizard auth_totp_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: auth_totp_wizard auth_totp_wizard_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: auth_totp_wizard auth_totp_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: badge_unlocked_definition_rel badge_unlocked_definition_rel_gamification_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.badge_unlocked_definition_rel
    ADD CONSTRAINT badge_unlocked_definition_rel_gamification_badge_id_fkey FOREIGN KEY (gamification_badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: badge_unlocked_definition_rel badge_unlocked_definition_rel_gamification_goal_definition_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.badge_unlocked_definition_rel
    ADD CONSTRAINT badge_unlocked_definition_rel_gamification_goal_definition_fkey FOREIGN KEY (gamification_goal_definition_id) REFERENCES public.gamification_goal_definition(id) ON DELETE CASCADE;


--
-- Name: barcode_nomenclature barcode_nomenclature_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: barcode_nomenclature barcode_nomenclature_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: barcode_rule barcode_rule_associated_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_associated_uom_id_fkey FOREIGN KEY (associated_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: barcode_rule barcode_rule_barcode_nomenclature_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_barcode_nomenclature_id_fkey FOREIGN KEY (barcode_nomenclature_id) REFERENCES public.barcode_nomenclature(id) ON DELETE SET NULL;


--
-- Name: barcode_rule barcode_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: barcode_rule barcode_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_document_layout base_document_layout_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_document_layout base_document_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_document_layout base_document_layout_report_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_document_layout
    ADD CONSTRAINT base_document_layout_report_layout_id_fkey FOREIGN KEY (report_layout_id) REFERENCES public.report_layout(id) ON DELETE SET NULL;


--
-- Name: base_document_layout base_document_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_enable_profiling_wizard base_enable_profiling_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_enable_profiling_wizard base_enable_profiling_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_import base_import_import_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_import base_import_import_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_mapping base_import_mapping_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_mapping base_import_mapping_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_module base_import_module_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_module base_import_module_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_export base_language_export_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_export base_language_export_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_language_export
    ADD CONSTRAINT base_language_export_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: base_language_export base_language_export_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_import base_language_import_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_import base_language_import_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_install base_language_install_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_install_website_rel base_language_install_website_rel_base_language_install_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_language_install_website_rel
    ADD CONSTRAINT base_language_install_website_rel_base_language_install_id_fkey FOREIGN KEY (base_language_install_id) REFERENCES public.base_language_install(id) ON DELETE CASCADE;


--
-- Name: base_language_install_website_rel base_language_install_website_rel_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_install base_language_install_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_request base_module_install_request_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_request base_module_install_request_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_request base_module_install_request_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_request base_module_install_request_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_review base_module_install_review_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_review base_module_install_review_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_review base_module_install_review_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_uninstall base_module_uninstall_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_uninstall base_module_uninstall_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_uninstall base_module_uninstall_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_update base_module_update_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_update base_module_update_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_upgrade base_module_upgrade_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_upgrade base_module_upgrade_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_automatic_wizard_res_partner_rel base_partner_merge_automatic__base_partner_merge_automatic_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard_res_partner_rel
    ADD CONSTRAINT base_partner_merge_automatic__base_partner_merge_automatic_fkey FOREIGN KEY (base_partner_merge_automatic_wizard_id) REFERENCES public.base_partner_merge_automatic_wizard(id) ON DELETE CASCADE;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_current_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_current_line_id_fkey FOREIGN KEY (current_line_id) REFERENCES public.base_partner_merge_line(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_dst_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_dst_partner_id_fkey FOREIGN KEY (dst_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard_res_partner_rel base_partner_merge_automatic_wizard_res_par_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_line base_partner_merge_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_line base_partner_merge_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_line
    ADD CONSTRAINT base_partner_merge_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.base_partner_merge_automatic_wizard(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_line base_partner_merge_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bill_to_po_wizard bill_to_po_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bill_to_po_wizard bill_to_po_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bill_to_po_wizard
    ADD CONSTRAINT bill_to_po_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: bill_to_po_wizard bill_to_po_wizard_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bill_to_po_wizard
    ADD CONSTRAINT bill_to_po_wizard_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE SET NULL;


--
-- Name: bill_to_po_wizard bill_to_po_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_bus bus_bus_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_bus bus_bus_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_presence bus_presence_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_presence bus_presence_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm_calendar_event_rel calendar_alarm_calendar_event_rel_calendar_alarm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm_calendar_event_rel
    ADD CONSTRAINT calendar_alarm_calendar_event_rel_calendar_alarm_id_fkey FOREIGN KEY (calendar_alarm_id) REFERENCES public.calendar_alarm(id) ON DELETE RESTRICT;


--
-- Name: calendar_alarm_calendar_event_rel calendar_alarm_calendar_event_rel_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm calendar_alarm_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm calendar_alarm_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm
    ADD CONSTRAINT calendar_alarm_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: calendar_alarm calendar_alarm_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm calendar_alarm_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_attendee
    ADD CONSTRAINT calendar_attendee_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: calendar_attendee calendar_attendee_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_recurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_recurrence_id_fkey FOREIGN KEY (recurrence_id) REFERENCES public.calendar_recurrence(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event_res_partner_rel calendar_event_res_partner_rel_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event_res_partner_rel calendar_event_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event_type calendar_event_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event_type calendar_event_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_videocall_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_videocall_channel_id_fkey FOREIGN KEY (videocall_channel_id) REFERENCES public.discuss_channel(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_filters
    ADD CONSTRAINT calendar_filters_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: calendar_filters calendar_filters_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_record_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_popover_delete_wizard
    ADD CONSTRAINT calendar_popover_delete_wizard_record_fkey FOREIGN KEY (record) REFERENCES public.calendar_event(id) ON DELETE SET NULL;


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_provider_config calendar_provider_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_provider_config calendar_provider_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_recurrence calendar_recurrence_base_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_recurrence
    ADD CONSTRAINT calendar_recurrence_base_event_id_fkey FOREIGN KEY (base_event_id) REFERENCES public.calendar_event(id) ON DELETE SET NULL;


--
-- Name: calendar_recurrence calendar_recurrence_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_recurrence calendar_recurrence_trigger_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_recurrence
    ADD CONSTRAINT calendar_recurrence_trigger_id_fkey FOREIGN KEY (trigger_id) REFERENCES public.ir_cron_trigger(id) ON DELETE SET NULL;


--
-- Name: calendar_recurrence calendar_recurrence_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_private_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_certificate
    ADD CONSTRAINT certificate_certificate_private_key_id_fkey FOREIGN KEY (private_key_id) REFERENCES public.certificate_key(id) ON DELETE SET NULL;


--
-- Name: certificate_certificate certificate_certificate_public_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_certificate
    ADD CONSTRAINT certificate_certificate_public_key_id_fkey FOREIGN KEY (public_key_id) REFERENCES public.certificate_key(id) ON DELETE SET NULL;


--
-- Name: certificate_certificate certificate_certificate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_own change_password_own_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_own change_password_own_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_user change_password_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_user change_password_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_user change_password_user_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.change_password_user
    ADD CONSTRAINT change_password_user_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.change_password_wizard(id) ON DELETE CASCADE;


--
-- Name: change_password_user change_password_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_wizard change_password_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_wizard change_password_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: confirm_stock_sms confirm_stock_sms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: confirm_stock_sms confirm_stock_sms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_tag crm_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_tag crm_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_team crm_team_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_team crm_team_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_team_member crm_team_member_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_team_member crm_team_member_crm_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.crm_team_member
    ADD CONSTRAINT crm_team_member_crm_team_id_fkey FOREIGN KEY (crm_team_id) REFERENCES public.crm_team(id) ON DELETE CASCADE;


--
-- Name: crm_team_member crm_team_member_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_team_member crm_team_member_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_team crm_team_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: crm_team crm_team_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: decimal_precision decimal_precision_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: decimal_precision decimal_precision_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: digest_digest digest_digest_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: digest_digest digest_digest_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: digest_digest_res_users_rel digest_digest_res_users_rel_digest_digest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.digest_digest_res_users_rel
    ADD CONSTRAINT digest_digest_res_users_rel_digest_digest_id_fkey FOREIGN KEY (digest_digest_id) REFERENCES public.digest_digest(id) ON DELETE CASCADE;


--
-- Name: digest_digest_res_users_rel digest_digest_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: digest_digest digest_digest_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: digest_tip digest_tip_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: digest_tip digest_tip_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.digest_tip
    ADD CONSTRAINT digest_tip_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE SET NULL;


--
-- Name: digest_tip_res_users_rel digest_tip_res_users_rel_digest_tip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.digest_tip_res_users_rel
    ADD CONSTRAINT digest_tip_res_users_rel_digest_tip_id_fkey FOREIGN KEY (digest_tip_id) REFERENCES public.digest_tip(id) ON DELETE CASCADE;


--
-- Name: digest_tip_res_users_rel digest_tip_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: digest_tip digest_tip_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel discuss_channel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel discuss_channel_from_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel
    ADD CONSTRAINT discuss_channel_from_message_id_fkey FOREIGN KEY (from_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: discuss_channel discuss_channel_group_public_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_hr_department_rel discuss_channel_hr_department_rel_discuss_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel_hr_department_rel
    ADD CONSTRAINT discuss_channel_hr_department_rel_discuss_channel_id_fkey FOREIGN KEY (discuss_channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_hr_department_rel discuss_channel_hr_department_rel_hr_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_member discuss_channel_member_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_member discuss_channel_member_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_member discuss_channel_member_fetched_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_member discuss_channel_member_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_member discuss_channel_member_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_member discuss_channel_member_rtc_inviting_session_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_rtc_inviting_session_id_fkey FOREIGN KEY (rtc_inviting_session_id) REFERENCES public.discuss_channel_rtc_session(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_member discuss_channel_member_seen_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_member discuss_channel_member_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel discuss_channel_parent_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel
    ADD CONSTRAINT discuss_channel_parent_channel_id_fkey FOREIGN KEY (parent_channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_res_groups_rel discuss_channel_res_groups_rel_discuss_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel_res_groups_rel
    ADD CONSTRAINT discuss_channel_res_groups_rel_discuss_channel_id_fkey FOREIGN KEY (discuss_channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_res_groups_rel discuss_channel_res_groups_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel_rtc_session
    ADD CONSTRAINT discuss_channel_rtc_session_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.discuss_channel(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_channel_member_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel_rtc_session
    ADD CONSTRAINT discuss_channel_rtc_session_channel_member_id_fkey FOREIGN KEY (channel_member_id) REFERENCES public.discuss_channel_member(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel discuss_channel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_gif_favorite discuss_gif_favorite_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_gif_favorite discuss_gif_favorite_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_voice_metadata discuss_voice_metadata_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_voice_metadata discuss_voice_metadata_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_voice_metadata discuss_voice_metadata_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: email_template_attachment_rel email_template_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: email_template_attachment_rel email_template_attachment_rel_email_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.email_template_attachment_rel
    ADD CONSTRAINT email_template_attachment_rel_email_template_id_fkey FOREIGN KEY (email_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: employee_category_rel employee_category_rel_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.employee_category_rel
    ADD CONSTRAINT employee_category_rel_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.hr_employee_category(id) ON DELETE CASCADE;


--
-- Name: employee_category_rel employee_category_rel_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: fetchmail_server fetchmail_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: fetchmail_server fetchmail_server_object_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.fetchmail_server
    ADD CONSTRAINT fetchmail_server_object_id_fkey FOREIGN KEY (object_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: fetchmail_server fetchmail_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge gamification_badge_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_rule_badge_rel gamification_badge_rule_badge_rel_badge1_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_rule_badge_rel
    ADD CONSTRAINT gamification_badge_rule_badge_rel_badge1_id_fkey FOREIGN KEY (badge1_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_rule_badge_rel gamification_badge_rule_badge_rel_badge2_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_rule_badge_rel
    ADD CONSTRAINT gamification_badge_rule_badge_rel_badge2_id_fkey FOREIGN KEY (badge2_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_user gamification_badge_user_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user
    ADD CONSTRAINT gamification_badge_user_badge_id_fkey FOREIGN KEY (badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_user gamification_badge_user_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user gamification_badge_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user gamification_badge_user_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user gamification_badge_user_sender_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user
    ADD CONSTRAINT gamification_badge_user_sender_id_fkey FOREIGN KEY (sender_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_badge_user gamification_badge_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user_wizard
    ADD CONSTRAINT gamification_badge_user_wizard_badge_id_fkey FOREIGN KEY (badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user gamification_badge_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge gamification_badge_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


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

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


--
-- Name: gamification_challenge_line gamification_challenge_line_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge_line
    ADD CONSTRAINT gamification_challenge_line_challenge_id_fkey FOREIGN KEY (challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE CASCADE;


--
-- Name: gamification_challenge_line gamification_challenge_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge_line gamification_challenge_line_definition_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge_line gamification_challenge_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


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

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


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

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_report_message_group_id_fkey FOREIGN KEY (report_message_group_id) REFERENCES public.discuss_channel(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_report_template_id_fkey FOREIGN KEY (report_template_id) REFERENCES public.mail_template(id) ON DELETE RESTRICT;


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

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_first_id_fkey FOREIGN KEY (reward_first_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_id_fkey FOREIGN KEY (reward_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_second_id_fkey FOREIGN KEY (reward_second_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_third_id_fkey FOREIGN KEY (reward_third_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


--
-- Name: gamification_challenge_users_rel gamification_challenge_users_rel_gamification_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge_users_rel gamification_challenge_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- 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: header_footer_quotation_template_rel header_footer_quotation_template_re_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.header_footer_quotation_template_rel
    ADD CONSTRAINT header_footer_quotation_template_re_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: header_footer_quotation_template_rel header_footer_quotation_template_rel_quotation_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.header_footer_quotation_template_rel
    ADD CONSTRAINT header_footer_quotation_template_rel_quotation_document_id_fkey FOREIGN KEY (quotation_document_id) REFERENCES public.quotation_document(id) ON DELETE CASCADE;


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

ALTER TABLE ONLY public.hr_contract_type
    ADD CONSTRAINT hr_contract_type_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(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_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 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_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_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_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_cv_wizard hr_employee_cv_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_cv_wizard hr_employee_cv_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_delete_wizard hr_employee_delete_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_delete_wizard hr_employee_delete_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_delete_wizard
    ADD CONSTRAINT hr_employee_delete_wizard_write_uid_fkey FOREIGN KEY (write_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_cv_wizard_rel hr_employee_hr_employee_cv_wizard_hr_employee_cv_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_employee_cv_wizard_rel
    ADD CONSTRAINT hr_employee_hr_employee_cv_wizard_hr_employee_cv_wizard_id_fkey FOREIGN KEY (hr_employee_cv_wizard_id) REFERENCES public.hr_employee_cv_wizard(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_employee_cv_wizard_rel hr_employee_hr_employee_cv_wizard_rel_hr_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_employee_cv_wizard_rel
    ADD CONSTRAINT hr_employee_hr_employee_cv_wizard_rel_hr_employee_id_fkey FOREIGN KEY (hr_employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_employee_delete_wizard_rel hr_employee_hr_employee_delet_hr_employee_delete_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_employee_delete_wizard_rel
    ADD CONSTRAINT hr_employee_hr_employee_delet_hr_employee_delete_wizard_id_fkey FOREIGN KEY (hr_employee_delete_wizard_id) REFERENCES public.hr_employee_delete_wizard(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_employee_delete_wizard_rel hr_employee_hr_employee_delete_wizard_rel_hr_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_employee_delete_wizard_rel
    ADD CONSTRAINT hr_employee_hr_employee_delete_wizard_rel_hr_employee_id_fkey FOREIGN KEY (hr_employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_skill_rel hr_employee_hr_skill_rel_hr_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_skill_rel
    ADD CONSTRAINT hr_employee_hr_skill_rel_hr_employee_id_fkey FOREIGN KEY (hr_employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_skill_rel hr_employee_hr_skill_rel_hr_skill_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_skill_rel
    ADD CONSTRAINT hr_employee_hr_skill_rel_hr_skill_id_fkey FOREIGN KEY (hr_skill_id) REFERENCES public.hr_skill(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_private_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


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

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_private_state_id_fkey FOREIGN KEY (private_state_id) REFERENCES public.res_country_state(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_skill hr_employee_skill_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill hr_employee_skill_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill_log hr_employee_skill_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill_log hr_employee_skill_log_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill_log hr_employee_skill_log_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill_log hr_employee_skill_log_skill_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_skill_id_fkey FOREIGN KEY (skill_id) REFERENCES public.hr_skill(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_skill_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_skill_level_id_fkey FOREIGN KEY (skill_level_id) REFERENCES public.hr_skill_level(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill hr_employee_skill_skill_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill
    ADD CONSTRAINT hr_employee_skill_skill_id_fkey FOREIGN KEY (skill_id) REFERENCES public.hr_skill(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill hr_employee_skill_skill_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill
    ADD CONSTRAINT hr_employee_skill_skill_level_id_fkey FOREIGN KEY (skill_level_id) REFERENCES public.hr_skill_level(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill hr_employee_skill_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill
    ADD CONSTRAINT hr_employee_skill_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill hr_employee_skill_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- 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 RESTRICT;


--
-- 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_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_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_resume_line hr_resume_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line hr_resume_line_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line hr_resume_line_line_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_resume_line
    ADD CONSTRAINT hr_resume_line_line_type_id_fkey FOREIGN KEY (line_type_id) REFERENCES public.hr_resume_line_type(id) ON DELETE SET NULL;


--
-- Name: hr_resume_line_type hr_resume_line_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line_type hr_resume_line_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line hr_resume_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill hr_skill_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill_level hr_skill_level_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill_level hr_skill_level_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_skill_level
    ADD CONSTRAINT hr_skill_level_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_skill_level hr_skill_level_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill hr_skill_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_skill
    ADD CONSTRAINT hr_skill_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_skill_type hr_skill_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill_type hr_skill_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill hr_skill_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_skill
    ADD CONSTRAINT hr_skill_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_res_users_rel iap_account_res_users_rel_iap_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: iap_account_res_users_rel iap_account_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


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

ALTER TABLE ONLY public.iap_account
    ADD CONSTRAINT iap_account_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.iap_service(id) ON DELETE RESTRICT;


--
-- 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: iap_service iap_service_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: iap_service iap_service_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.iap_service
    ADD CONSTRAINT iap_service_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_selection_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_selection_value_fkey FOREIGN KEY (selection_value) REFERENCES public.ir_model_fields_selection(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_update_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_update_field_id_fkey FOREIGN KEY (update_field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


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

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


--
-- Name: ir_act_server_webhook_field_rel ir_act_server_webhook_field_rel_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: ir_act_server_webhook_field_rel ir_act_server_webhook_field_rel_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- 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_progress ir_cron_progress_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: ir_cron_progress ir_cron_progress_cron_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.ir_cron_progress
    ADD CONSTRAINT ir_cron_progress_cron_id_fkey FOREIGN KEY (cron_id) REFERENCES public.ir_cron(id) ON DELETE CASCADE;


--
-- Name: ir_cron_progress ir_cron_progress_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- 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;


--
