Přejít na obsah
Menu
This question has been flagged
1023 Zobrazení

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


Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
led 25
1130
1
bře 25
949
0
led 25
816
0
čvn 24
1458
1
čvn 25
488