49. One2many Field In Odoo 15 || Odoo Relational Fields || Odoo 15 Development Tutorials

  Рет қаралды 17,749

Odoo Mates

Odoo Mates

Күн бұрын

Пікірлер: 44
@UtsavKumarMalviya
@UtsavKumarMalviya Жыл бұрын
Nicely explained, I am getting complete form view of base model, however i add only tree view in my one2many field?
@OdooMates
@OdooMates Жыл бұрын
if you haven't defined form view for the model, odoo will show auto generated form view for the model
@asero82.
@asero82. Жыл бұрын
Useful tutorial. I want to know if is it possible to use a specify pricelist for the product price? Let's say if a business requirement is to use a pricelist with ID 2 for products used in pharmacy lines, how could I set this up? Thanks in advance.
@MrHighvolt
@MrHighvolt 2 жыл бұрын
Thanks for the video!
@OdooMates
@OdooMates 2 жыл бұрын
Thanks for the support ❤️❤️❤️❤️
@javedshoukat3538
@javedshoukat3538 11 ай бұрын
Hi Odoo mates thank you for the useful video. Plz share how we can get the latest entered record from one2many fileld in another modules and how to show in view of that other module. Like from this One2many field you created, the last added medicine name only, show it in sale module, just under the Customer name. Plz help
@SamirSELLAMI
@SamirSELLAMI 2 жыл бұрын
In Odoo14, I keep getting the following error : File "C:\Odoo14\odoo\odoo\models.py", line 5168, in _update_cache raise ValueError("Invalid field %r on model %r" % (e.args[0], self._name)) Exception should I watch the video of Odoo14 tutorial ?
@OdooMates
@OdooMates 2 жыл бұрын
can you show us what code you have recently added
@SamirSELLAMI
@SamirSELLAMI 2 жыл бұрын
​@@OdooMates Hi, let me explain my scenario: I have two child models B and C _inherit from parent model A. The main model A has a One2many relationship with another model D. The problem occurs when interacting with "field_ids" added to the views of B and C. However, the error does not occur when declaring the One2many relationship field between child model B and D for example! but this does not make sense to me, because in this case model D will have multiple Many2one fields ("B_id" and "C_id"] referring to child models B and C respectively, instead of a single Many2one field "A_id" referring to the main model A, so maybe the One2many relationship is not supported in the _inherit mode?
@wilfredocristobalolanochav5789
@wilfredocristobalolanochav5789 2 жыл бұрын
Muchas gracias por compartir, saludos
@OdooMates
@OdooMates 2 жыл бұрын
gracias por el apoyo hermano
@superjose278
@superjose278 Жыл бұрын
i had an error when try to save changes with two or more records in product list (area of multiple lines or products), ValueError: Expected singleton: concesion.internacional.lines(5, 6). What could be happend? Thanks
@OdooMates
@OdooMates Жыл бұрын
kzbin.info/www/bejne/iKeXZaF8i9OSa7c
@StepUpG-j8m
@StepUpG-j8m Жыл бұрын
Hi Odoo mates, thanks for your video tutorials they are really helpful. I noticed some issues even though I followed this video of One2many fields step by step. First, I'm developing on Odoo 16, and when I followed the exact steps in this video, the Add a line section as can been seen in the video @ 11:03, does not display in the UI. Secondly, products lists do not display in the UI as well. Can you help me in getting around this issue? Thanks. Update: I'd like to say that I have been able to figure out what the issue was, and I have had it fixed. Thanks for your time.
@moatazachour5529
@moatazachour5529 2 ай бұрын
how do you fixed my friend
@OdooMates
@OdooMates 2 ай бұрын
Try with super use mode and see how it goes
@medomedop2566
@medomedop2566 Жыл бұрын
i have this error while try to add a line "Uncaught Promise > Cannot read properties of undefined (reading 'append') " but it is disappear when I add editable="bottom" in tree tag so what is the problem and this problem every where I try to add a line
@pranavbhat92
@pranavbhat92 2 жыл бұрын
Thank you for the video! I was able to get the product lists without adding the dependency in the manifest file. Thats weird. 🤔
@OdooMates
@OdooMates 2 жыл бұрын
Glad to hear it
@pranavbhat92
@pranavbhat92 2 жыл бұрын
@@OdooMates Sorry I spoke too soon. When I added the 'related' field for the price_unit, I started getting the error. After adding the dependency, the error vanished. Once again, thanks for covering everything in detail! 😀
@OdooMates
@OdooMates 2 жыл бұрын
❤️❤️❤️ thanks for the support brother
@FunnyDay.5631
@FunnyDay.5631 Жыл бұрын
I'm getting the output but when i create tree view for that it showing "price" does not exist in model "hospital.appointment"
@OdooMates
@OdooMates Жыл бұрын
is it resolved ?
@FunnyDay.5631
@FunnyDay.5631 Жыл бұрын
No
@ShadHastam
@ShadHastam 8 ай бұрын
Thanks
@OdooMates
@OdooMates 3 ай бұрын
Welcome
@chaotixsniper
@chaotixsniper 2 жыл бұрын
i have a problem with the security file : Exception: Module loading om_hospital failed: file om_hospital\security/ir.model.access.csv could not be processed: No matching record found for external id 'om_hospital.model_appointment_availability_lines' in field 'Model' Missing required value for the field 'Model' (model_id) i got this error when i upgraded the module ..
@OdooMates
@OdooMates 2 жыл бұрын
do you have a model named: appointment_availability_lines in the module and imported the file in init file ?
@chaotixsniper
@chaotixsniper 2 жыл бұрын
@@OdooMates no i just followed your steps i just changed the naming, instead of appointment_pharmacy_lines i named it appointment_availability_lines.. I have the same models as you in this tutorial.
@OdooMates
@OdooMates 2 жыл бұрын
So you need to set access rights for appointment availability model ?
@chaotixsniper
@chaotixsniper 2 жыл бұрын
@@OdooMates yeah i did exactly the same way you did and still get the error when i upgrade the module
@mohamedsobh2626
@mohamedsobh2626 2 жыл бұрын
in a patient form, an one2many tree of appointments (editable is false), then create a new appointment line a form popup, how to pass the patient id to the appointment form?
@OdooMates
@OdooMates 2 жыл бұрын
Is it one2many form ?
@mohamedsobh2626
@mohamedsobh2626 2 жыл бұрын
@@OdooMates yes
@OdooMates
@OdooMates 2 жыл бұрын
@@mohamedsobh2626 kzbin.info/www/bejne/mJinhKyHj92Sn6s
@OdooMates
@OdooMates 2 жыл бұрын
@@mohamedsobh2626 using context you can pass default value to one2many
@mohamedsobh2626
@mohamedsobh2626 2 жыл бұрын
context accept any field, except the active_id at one2many popup form 😀
@hulkavenger8790
@hulkavenger8790 2 жыл бұрын
Can you tell me why one to one concept is not used in odoo...?
@OdooMates
@OdooMates 2 жыл бұрын
No specific reason, using many2one we can achive the same right ?
@nicorey.
@nicorey. 11 ай бұрын
Bro Why i cant fix the product_id error?, i already add the product to depend do you know how to fix this?
@abdelrahmanalaa4539
@abdelrahmanalaa4539 10 ай бұрын
did you fix it bro ?? plz help
@eventdz6182
@eventdz6182 2 жыл бұрын
hi I get this erreur and I don't know how to fix it: AttributeError: '_unknown' object has no attribute 'id'
@OdooMates
@OdooMates 2 жыл бұрын
Can you show us the code that you have added
@eventdz6182
@eventdz6182 2 жыл бұрын
@@OdooMates ​this is appoitement class from odoo import models, fields, api from datetime import datetime class HospitalAppointement(models.Model): _name = 'hospitaleila.appointement' _inherit=['mail.thread', 'mail.activity.mixin'] _description = 'hospitaleila appointement' _rec_name ='patient_id' patient_id=fields.Many2one('hospitaleila.patient',string="Patient") gender = fields.Selection(related='patient_id.gender') appointment_time = fields.Datetime(string='Appointment time' ,default=fields.Datetime.now) booking_date = fields.Date(string='Booking Date',default=fields.Date.context_today) ref = fields.Char(string='Refrence') prescription = fields.Html(string='prescription') priority = fields.Selection([ ('0', 'Normal'), ('1', 'Low'), ('2', 'High'), ('3', 'Very High') ], string='Priority') state = fields.Selection([ ('draft', 'Draft'), ('in_consultation', 'In Consultation'), ('done', 'Done'), ('cancel', 'Cancel') ], string='State',default='draft',required=True) doctor_id=fields.Many2one('res.users',string="Doctore",tracking=True) appointment_availability_lines = fields.One2many('appointement.pharmacy.lines','appointement_id',string='Sessions') def action_in_consultation(self): for rec in self: rec.state='in_consultation' def action_done(self): for rec in self: rec.state='done' def action_cancel(self): for rec in self: rec.state='cancel' def action_draft(self): for rec in self: rec.state='draft' def action_test(self): print("botton clicked //////////////") return{ 'effect':{ 'fadeout':'slow', 'message':'Click Successfull', 'type':'rainbow_man', } } @api.onchange('patient_id') def onchange_patient_id(self): self.ref = self.patient_id.ref class AppointementPharmacyLine(models.Model): _name = 'appointement.pharmacy.lines' _description='apointement pharmacy lines' product_id =fields.Many2one('product.product') proice_unit=fields.Float(string='Price') qty=fields.Integer(string='Quantity') appointement_id=fields.Many2one('hospital.appointement',string="appointement") __manifest__.py # -*- encoding: utf-8 -*- { "name": "Test Hospital management ", "version": "1.2.0", "author": "Hospital HASNAOUI Leila test ", "website": "www.odoo.com", "sequence": 0, "category": '', "license": "LGPL-3", "depends": ['mail','product'], "description": """ """, 'summary': 'Gestion complète de votre centre de Hospital', "data": [ "security/ir.model.access.csv", "views/menuItems.xml", "views/patient.xml", "views/patient_tag.xml", "views/appointement.xml", "views/femalePatient.xml", ], "auto_install": False, "installable": True, "application": True, } appointement.xml hospital.appointement.activity hospitaleila.appointement hospital.appointement.tree hospitaleila.appointement hospital.appointement.form hospitaleila.appointement hospital.appointement.search hospitaleila.appointement Appointement ir.actions.act_window hospitaleila.appointement tree,form,activity Cliquez pour créer une nouvelle Appiontement. thanks for your replayed
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 29 МЛН
Epic Reflex Game vs MrBeast Crew 🙈😱
00:32
Celine Dept
Рет қаралды 35 МЛН
How to Add One2many Fields In Odoo
19:37
Odoo Mates
Рет қаралды 40 М.
3 Types of Projects That Will Make You a Programmer
8:12
Andy Sterkowitz
Рет қаралды 1 МЛН
Odoo many2one, many2many, & one2many explained
6:48
Richard Shall
Рет қаралды 10 М.
programming projects that taught me how to code
9:49
isak
Рет қаралды 295 М.
How Shadcn/ui ACTUALLY Works
32:38
Theo - t3․gg
Рет қаралды 103 М.
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34