コンテンツへスキップ
メニュー
この質問にフラグが付けられました

Hello everyone,

I am encountering an issue with my Odoo setup where I want users to register pets via a form on the website. However, the problem is that the logged-in user is not being linked to the pet record when the form is submitted. Here are the details:

Setup Details:

  1. Pet Model Fields:
    • Name
    • Type
    • Description
    • Age
    • Contact (Many2one field linking to res.partner)
  2. User Model Fields:
    • Name
    • Email
    • Phone Number
    • Language
    • Total Pets (One2many field linking to pet with inverse field Contact)

Issue:

When a user submits the pet registration form on the website:

  • The pet record is created successfully.
  • The Contact field in the pet record is not populated with the logged-in user.
  • The Owner has to manually select his Contact record. I don't want the logged in user to be able to see other contacts records e.g. should be only able to see his/her own name.

Request for Help:

I need guidance on the following:

  1. How to automatically link the logged-in user to the pet record when the form is submitted on the website.
  2. Ensuring that the Total Pets field in the User model updates correctly when a new pet is registered.

Any help or insights into resolving this issue would be greatly appreciated. If there's a better way to achieve this, please let me know. Thank you!

Best regards, Khachaturyan Alain


アバター
破棄
関連投稿 返信 ビュー 活動
1
1月 25
1127
1
3月 25
948
0
1月 25
816
0
6月 24
1456
1
6月 25
486