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.
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 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?
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
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.
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
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
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 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 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! 😀
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?
Thanks for the video!
Thanks for the support ❤️❤️❤️❤️
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.
how do you fixed my friend
Try with super use mode and see how it goes
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 ?
can you show us what code you have recently added
@@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?
Muchas gracias por compartir, saludos
gracias por el apoyo hermano
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
ruclips.net/video/Rv44nFVn_5U/видео.html
Nicely explained, I am getting complete form view of base model, however i add only tree view in my one2many field?
if you haven't defined form view for the model, odoo will show auto generated form view for the model
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.
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
I'm getting the output but when i create tree view for that it showing "price" does not exist in model "hospital.appointment"
is it resolved ?
No
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
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 ..
do you have a model named: appointment_availability_lines in the module and imported the file in init file ?
@@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.
So you need to set access rights for appointment availability model ?
@@OdooMates yeah i did exactly the same way you did and still get the error when i upgrade the module
Thank you for the video!
I was able to get the product lists without adding the dependency in the manifest file. Thats weird. 🤔
Glad to hear it
@@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! 😀
❤️❤️❤️ thanks for the support brother
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?
Is it one2many form ?
@@OdooMates yes
@@mohamedsobh2626 ruclips.net/video/bgDSyQZx_iI/видео.html
@@mohamedsobh2626 using context you can pass default value to one2many
context accept any field, except the active_id at one2many popup form 😀
Thanks
Welcome
hi I get this erreur and I don't know how to fix it: AttributeError: '_unknown' object has no attribute 'id'
Can you show us the code that you have added
@@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
Can you tell me why one to one concept is not used in odoo...?
No specific reason, using many2one we can achive the same right ?
Bro Why i cant fix the product_id error?, i already add the product to depend do you know how to fix this?
did you fix it bro ??
plz help