hello thanks for your help, I have resolve the issue, it was a problem of indentation should be careful. Thanks again
@OdooMates5 жыл бұрын
Like the videos and sunshine the channel...also please refer the channel and videos in your friend circle :)
@root19962 жыл бұрын
Can you please explain how to make one sequence for more than one app , E.g : one invoice number for all invoices either from POS app or from Sales app .
@OdooMates2 жыл бұрын
by using the same method it is possible. suppose if you do as mentioned in the video and if the patient is created from sales app and if patient is created from pos app, it will have same sequence right ? as it is set from the create method of that model
@henrypcs63244 жыл бұрын
hello i have a question, why when i try to upgrade the models it keeps getting error like this "name '_' is not defined" i dont know what went wrong
@OdooMates4 жыл бұрын
import it, from odoo import fields, models, api, _
@henrypcs63244 жыл бұрын
@@OdooMates thanks mate, solved the problem. your tutorial is very helpfull please make more content like this... cheers
@OdooMates4 жыл бұрын
Happy to hear it :)
@SaniyaKhan-fb6pd3 жыл бұрын
Dear sir, after upgrading the hospital, it is showing "New" in order reference column instead of "HP001". Please help. Thanks. @OdooMates
@OdooMates3 жыл бұрын
@SaniyaKhan-fb6pd3 жыл бұрын
@Ricardo Roisman how
@SaniyaKhan-fb6pd3 жыл бұрын
@@OdooMates how can I create new item sir
@OdooMates3 жыл бұрын
@@SaniyaKhan-fb6pd he mean create new patient
@SaniyaKhan-fb6pd3 жыл бұрын
@@OdooMates Thank you my issue is resolved☺
@hardeepchhabra4505 жыл бұрын
GOD BLESS YOU
@mohamedtarek6084 жыл бұрын
u saved me bro keep going
@OdooMates4 жыл бұрын
Hope you will like all the video and refer the channel with Odoo friends :(
@amireshaq3 жыл бұрын
The best series
@OdooMates3 жыл бұрын
Thanks brother
@megasaab29154 жыл бұрын
If a have many projects and in each projects a want to sequence with will start again from 1? what can I do?
@OdooMates4 жыл бұрын
Did you solved ?
@megasaab29154 жыл бұрын
@@OdooMates yes i tried to create onchange function, it works) but your solution prefer for single objects.
@OdooMates4 жыл бұрын
@@megasaab2915 Yes, you are looking advanced one, you can check how the invoice sequence works
@erickindratara33072 жыл бұрын
if you upgrade this odoo 12 to odoo 14, does the sequence number (py Code file) is gone?
@OdooMates2 жыл бұрын
you mean upgrading the database ?
@erickindratara33072 жыл бұрын
@@OdooMates hmm I am not sure, but next time odoo 16 launched, I am sure I have to upgrade to that version.. and btw, you know how to activate odoo studio in community?
@OdooMates2 жыл бұрын
Won't loose any data, it is the responsibility of one who do to the db migration to keep the data safe
@OdooMates2 жыл бұрын
@@erickindratara3307 studio is an enterprise module
@megasaab29154 жыл бұрын
I use project scrum module, I have project which have many sprints, my sprints have sequence, but it is not depending from projects. if I create project I see project 1 sprint1 sprint2 sprint3, project2 sprint4 sprint5.... I need project 1 - sprint1,sprint2. project2 -sprint1,sprint2 help me pls
@AdeshPaul4 жыл бұрын
Dear sir, after upgrading the hospital, it is showing "New" in order reference column instead of "HP001". Please help. Thanks.
@OdooMates4 жыл бұрын
Can I see your code regarding the sequence
@AdeshPaul4 жыл бұрын
@@OdooMates sir, it was a mistake in patient.py file. Thanks for the support.
@OdooMates4 жыл бұрын
@@AdeshPaul so its okay now right
@AdeshPaul4 жыл бұрын
@@OdooMates yes sir, it's working fine. Thanks again.
@OdooMates4 жыл бұрын
@@NEWBABARLHR hope you solved the issue ? as there is no update="1", the changes made to the sequence after installing wotn affect. uninstall modulem remove noupdate="1" and try
@omarahmed2994 жыл бұрын
good but i have an error because of company_id in sequence.xml file Second : i don't completely understand this function @api.model def create(self, vals): if vals.get('name_seq', _('New')) == _('New'): vals['name_seq'] = self.env['ir.sequence'].next_by_code('hospital.patient.sequence') or _('New') result = super(HospitalPatient, self).create(vals) return result is there more explain thanks
@abduljabbar83833 жыл бұрын
my all things are ok but sequence is not working on form new is coming every time.
@OdooMates3 жыл бұрын
Can i see the sequence record you have added in the xml file
@neilsenarnachellum1665 жыл бұрын
hello i'm actually encountering a problem, I have followed the tutorial as shown and there is no error in code, but when i'm creating a new patient it doesn't generate a reference number. Reference number remains 'New' in tree view and form view for the created patient. Can you help me please?
@OdooMates5 жыл бұрын
Did you given the code correctly ? Please verify it from here: github.com/odoomates/Development-Tutorials
@neilsenarnachellum1665 жыл бұрын
@@OdooMates Thank for your reply, I'm developing accordingly thus yes at this stage the code is correct. My sequence has been successfully created in setting> Technical>sequences. But when I create a new patient, the 'order reference' field value is 'New' in tree view and it shows Patient/New in form view. I don't get the sequence number 'HP..'! I don't understand why?please help
@OdooMates5 жыл бұрын
@@neilsenarnachellum166 Show us the code of field and create method
@neilsenarnachellum1665 жыл бұрын
@@OdooMates I have change the code accordingly to me but its easy to get it. I have just change 'Hospital' to 'Vpc' and 'patient' to 'Client'. Client.py: from odoo import models, fields, api, _ class VpcClient(models.Model): _name = 'vpc.client' _inherit =['mail.thread', 'mail.activity.mixin'] _description = 'Client Records' _rec_name = "client_name" client_name = fields.Char(string='Name', required=True) client_age = fields.Integer('Age') notes = fields.Text(string='Notes') image = fields.Binary(string='Image') name = fields.Char(string='Test') name_seq = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, index=True, default=lambda self: _('New')) @api.model def create(self, vals): if vals.get('name_seq', _('New')) == _('New'): vals['name_seq'] = self.env['ir.sequence'].next_by_code('vpc.client.sequence') result = super(VpcClient, self).create(vals) return result -------------------------------------------------------------------------------------------- sequence.xml Client Sequence vpc.client.sequence VPC 3 ------------------------------------------------------------------------------------------- Client.xml vpc.client.tree vpc.client vpc.client.form vpc.client Clients ir.actions.act_window vpc.client form tree,kanban,form Create your First Client ! please help!!!!
@neilsenarnachellum1665 жыл бұрын
Do I need to connect the client to the contact? Or do I miss a depend in manifest? I don't know
@naoufelabdi62423 жыл бұрын
is this working for the version Odoo 13.00 ? I ve tried this but it's give me back a lot of errors, please some help
@OdooMates3 жыл бұрын
May I know what is the error ?
@naoufelabdi62423 жыл бұрын
@@OdooMates Erreur: Odoo Server Error Traceback (most recent call last): File "C:\Program Files (x86)\Odoo 13.0\server\odoo\api.py", line 745, in get value = self._data[field][record._ids[0]] KeyError: 474 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files (x86)\Odoo 13.0\server\odoo\fields.py", line 1037, in __get__ value = env.cache.get(record, self) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\api.py", line 751, in get raise CacheMiss(record, field) odoo.exceptions.CacheMiss: ('ir.actions.act_window(474,).search_view', None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 624, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 310, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\pycompat.py", line 14, in reraise raise value File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 669, in dispatch result = self._call_function(**self.params) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 350, in _call_function return checked_call(self.db, *args, **kwargs) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\service\model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 339, in checked_call result = self.endpoint(*a, **kw) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 915, in __call__ return self.method(*args, **kw) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 515, in response_wrap response = f(*args, **kw) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\web\controllers\main.py", line 1654, in load action = request.env[action_type].browse([action_id]).read() File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_actions.py", line 193, in read result = super(IrActionsActWindow, self).read(fields, load=load) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\models.py", line 2965, in read vals[name] = convert(record[name], record, use_name_get) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\models.py", line 5731, in __getitem__ return self._fields[key].__get__(self, type(self)) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\fields.py", line 1061, in __get__ self.compute_value(recs) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\fields.py", line 1146, in compute_value records._compute_field_value(self) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\models.py", line 4003, in _compute_field_value getattr(self, field.compute)() File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_actions.py", line 160, in _compute_search_view fvg = self.env[act.res_model].fields_view_get(act.search_view_id.id, 'search') File "C:\Program Files (x86)\Odoo 13.0\server\odoo\api.py", line 463, in __getitem__ return self.registry[model_name]._browse(self, (), ()) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\modules egistry.py", line 177, in __getitem__ return self.models[model_name] KeyError: 'modulnv.modulnv'
@OdooMates3 жыл бұрын
@@naoufelabdi6242 can you show us the code you have added
@naoufelabdi62423 жыл бұрын
The same as you explained in the video above
@OdooMates3 жыл бұрын
@@naoufelabdi6242 can you comment those codes related to the sequence and see, whether the error is still there,
@SingerSamehBashnak5 жыл бұрын
i have this problem..help if you can and thank you index=True, default=lambda self: _('New')) NameError: name '_' is not defined
@OdooMates5 жыл бұрын
add this line, from odoo import _
@SingerSamehBashnak5 жыл бұрын
@@OdooMates thank you very much it is resolve by this ...
@OdooMates5 жыл бұрын
@@SingerSamehBashnak Like, subscribe and support the channel. Hope you will refer the channel to your friends circles ...
@mudassiralizaidi24174 жыл бұрын
error is resolved by just importing the _ please tell me what is the reason behind this and want to know about the logic code of sequence vals['name_seq'] = self.env['ir.sequence'].next_by_code('sequence.task') or _('New') result = super(Task, self)._create(vals) of this two lines
@OdooMates4 жыл бұрын
self.env['ir.sequence'] for accessing the sequence model and to get the next sequence number and to assign the generated sequence to the variable
@mudassiralizaidi24174 жыл бұрын
And why we are calling the function again Super(task,self)._create(vals)
on _('New') python showing error before _ and kindly tell me what is the use of _
@OdooMates4 жыл бұрын
its for translating the string
@mudassiralizaidi24174 жыл бұрын
Thank you mate ❤
@iGuntaram4 жыл бұрын
How to create seq base on selected field?
@mayanxoni4 жыл бұрын
Can you please share a video on "how to add multiple views in a custom module"?
@OdooMates4 жыл бұрын
Multiple views for same model ? or can you explain little more brother ..
@mayanxoni4 жыл бұрын
@@OdooMates I'm sorry, I meant multiple models/views for providing more functionality through a single custom module, rather than just a single functionality. E.g.: om_hospital can have multiple functionalities like sending medicine alert to doctors/nurses, payment portals for patients, etc. all in a single module.
@mudassiralizaidi24174 жыл бұрын
@@mayanxoni are you saying that you want to add more functionalities in your model
@hussamcheema4 жыл бұрын
you didn't explain the code!!
@OdooMates4 жыл бұрын
Didn't understand the working ?
@hussamcheema4 жыл бұрын
@@OdooMates Understood everything except that create() method and why did you use @api.model before this method?
@usmanfarzand40785 жыл бұрын
Your Speaking Speed is to fast .....
@OdooMates5 жыл бұрын
Thanks for the comment. We will improve on it :)
@charoliyamujahid5265 жыл бұрын
Explain with code
@OdooMates5 жыл бұрын
Its already explained in the Video
@charoliyamujahid5265 жыл бұрын
env['ir.sequece].next_by_code['hospital.patient] or ('new') not explain inside create function code
@OdooMates5 жыл бұрын
@@charoliyamujahid526 Okay, see, we are searching the model ir.sequence by the given code to get the next number in sequence