How to Add New Sequence in odoo12

  Рет қаралды 24,036

Odoo Mates

Odoo Mates

Күн бұрын

Пікірлер: 79
@neilsenarnachellum166
@neilsenarnachellum166 5 жыл бұрын
hello thanks for your help, I have resolve the issue, it was a problem of indentation should be careful. Thanks again
@OdooMates
@OdooMates 5 жыл бұрын
Like the videos and sunshine the channel...also please refer the channel and videos in your friend circle :)
@root1996
@root1996 2 жыл бұрын
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 .
@OdooMates
@OdooMates 2 жыл бұрын
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
@henrypcs6324
@henrypcs6324 4 жыл бұрын
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
@OdooMates
@OdooMates 4 жыл бұрын
import it, from odoo import fields, models, api, _
@henrypcs6324
@henrypcs6324 4 жыл бұрын
@@OdooMates thanks mate, solved the problem. your tutorial is very helpfull please make more content like this... cheers
@OdooMates
@OdooMates 4 жыл бұрын
Happy to hear it :)
@SaniyaKhan-fb6pd
@SaniyaKhan-fb6pd 3 жыл бұрын
Dear sir, after upgrading the hospital, it is showing "New" in order reference column instead of "HP001". Please help. Thanks. @OdooMates
@OdooMates
@OdooMates 3 жыл бұрын
@SaniyaKhan-fb6pd
@SaniyaKhan-fb6pd 3 жыл бұрын
@Ricardo Roisman how
@SaniyaKhan-fb6pd
@SaniyaKhan-fb6pd 3 жыл бұрын
@@OdooMates how can I create new item sir
@OdooMates
@OdooMates 3 жыл бұрын
@@SaniyaKhan-fb6pd he mean create new patient
@SaniyaKhan-fb6pd
@SaniyaKhan-fb6pd 3 жыл бұрын
@@OdooMates Thank you my issue is resolved☺
@hardeepchhabra450
@hardeepchhabra450 5 жыл бұрын
GOD BLESS YOU
@mohamedtarek608
@mohamedtarek608 4 жыл бұрын
u saved me bro keep going
@OdooMates
@OdooMates 4 жыл бұрын
Hope you will like all the video and refer the channel with Odoo friends :(
@amireshaq
@amireshaq 3 жыл бұрын
The best series
@OdooMates
@OdooMates 3 жыл бұрын
Thanks brother
@megasaab2915
@megasaab2915 4 жыл бұрын
If a have many projects and in each projects a want to sequence with will start again from 1? what can I do?
@OdooMates
@OdooMates 4 жыл бұрын
Did you solved ?
@megasaab2915
@megasaab2915 4 жыл бұрын
@@OdooMates yes i tried to create onchange function, it works) but your solution prefer for single objects.
@OdooMates
@OdooMates 4 жыл бұрын
@@megasaab2915 Yes, you are looking advanced one, you can check how the invoice sequence works
@erickindratara3307
@erickindratara3307 2 жыл бұрын
if you upgrade this odoo 12 to odoo 14, does the sequence number (py Code file) is gone?
@OdooMates
@OdooMates 2 жыл бұрын
you mean upgrading the database ?
@erickindratara3307
@erickindratara3307 2 жыл бұрын
@@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?
@OdooMates
@OdooMates 2 жыл бұрын
Won't loose any data, it is the responsibility of one who do to the db migration to keep the data safe
@OdooMates
@OdooMates 2 жыл бұрын
@@erickindratara3307 studio is an enterprise module
@megasaab2915
@megasaab2915 4 жыл бұрын
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
@AdeshPaul
@AdeshPaul 4 жыл бұрын
Dear sir, after upgrading the hospital, it is showing "New" in order reference column instead of "HP001". Please help. Thanks.
@OdooMates
@OdooMates 4 жыл бұрын
Can I see your code regarding the sequence
@AdeshPaul
@AdeshPaul 4 жыл бұрын
​@@OdooMates sir, it was a mistake in patient.py file. Thanks for the support.
@OdooMates
@OdooMates 4 жыл бұрын
@@AdeshPaul so its okay now right
@AdeshPaul
@AdeshPaul 4 жыл бұрын
@@OdooMates yes sir, it's working fine. Thanks again.
@OdooMates
@OdooMates 4 жыл бұрын
@@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
@omarahmed299
@omarahmed299 4 жыл бұрын
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
@abduljabbar8383
@abduljabbar8383 3 жыл бұрын
my all things are ok but sequence is not working on form new is coming every time.
@OdooMates
@OdooMates 3 жыл бұрын
Can i see the sequence record you have added in the xml file
@neilsenarnachellum166
@neilsenarnachellum166 5 жыл бұрын
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?
@OdooMates
@OdooMates 5 жыл бұрын
Did you given the code correctly ? Please verify it from here: github.com/odoomates/Development-Tutorials
@neilsenarnachellum166
@neilsenarnachellum166 5 жыл бұрын
@@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
@OdooMates
@OdooMates 5 жыл бұрын
@@neilsenarnachellum166 Show us the code of field and create method
@neilsenarnachellum166
@neilsenarnachellum166 5 жыл бұрын
@@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!!!!
@neilsenarnachellum166
@neilsenarnachellum166 5 жыл бұрын
Do I need to connect the client to the contact? Or do I miss a depend in manifest? I don't know
@naoufelabdi6242
@naoufelabdi6242 3 жыл бұрын
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
@OdooMates
@OdooMates 3 жыл бұрын
May I know what is the error ?
@naoufelabdi6242
@naoufelabdi6242 3 жыл бұрын
@@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'
@OdooMates
@OdooMates 3 жыл бұрын
@@naoufelabdi6242 can you show us the code you have added
@naoufelabdi6242
@naoufelabdi6242 3 жыл бұрын
The same as you explained in the video above
@OdooMates
@OdooMates 3 жыл бұрын
@@naoufelabdi6242 can you comment those codes related to the sequence and see, whether the error is still there,
@SingerSamehBashnak
@SingerSamehBashnak 5 жыл бұрын
i have this problem..help if you can and thank you index=True, default=lambda self: _('New')) NameError: name '_' is not defined
@OdooMates
@OdooMates 5 жыл бұрын
add this line, from odoo import _
@SingerSamehBashnak
@SingerSamehBashnak 5 жыл бұрын
@@OdooMates thank you very much it is resolve by this ...
@OdooMates
@OdooMates 5 жыл бұрын
@@SingerSamehBashnak Like, subscribe and support the channel. Hope you will refer the channel to your friends circles ...
@mudassiralizaidi2417
@mudassiralizaidi2417 4 жыл бұрын
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
@OdooMates
@OdooMates 4 жыл бұрын
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
@mudassiralizaidi2417
@mudassiralizaidi2417 4 жыл бұрын
And why we are calling the function again Super(task,self)._create(vals)
@OdooMates
@OdooMates 4 жыл бұрын
@@mudassiralizaidi2417 kzbin.info/www/bejne/i5awg3iGrrqWiK8&vl=en
@mayanxoni
@mayanxoni 4 жыл бұрын
Thank you so much for he video
@OdooMates
@OdooMates 4 жыл бұрын
My pleasure
@mudassiralizaidi2417
@mudassiralizaidi2417 4 жыл бұрын
on _('New') python showing error before _ and kindly tell me what is the use of _
@OdooMates
@OdooMates 4 жыл бұрын
its for translating the string
@mudassiralizaidi2417
@mudassiralizaidi2417 4 жыл бұрын
Thank you mate ❤
@iGuntaram
@iGuntaram 4 жыл бұрын
How to create seq base on selected field?
@mayanxoni
@mayanxoni 4 жыл бұрын
Can you please share a video on "how to add multiple views in a custom module"?
@OdooMates
@OdooMates 4 жыл бұрын
Multiple views for same model ? or can you explain little more brother ..
@mayanxoni
@mayanxoni 4 жыл бұрын
@@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.
@mudassiralizaidi2417
@mudassiralizaidi2417 4 жыл бұрын
@@mayanxoni are you saying that you want to add more functionalities in your model
@hussamcheema
@hussamcheema 4 жыл бұрын
you didn't explain the code!!
@OdooMates
@OdooMates 4 жыл бұрын
Didn't understand the working ?
@hussamcheema
@hussamcheema 4 жыл бұрын
@@OdooMates Understood everything except that create() method and why did you use @api.model before this method?
@usmanfarzand4078
@usmanfarzand4078 5 жыл бұрын
Your Speaking Speed is to fast .....
@OdooMates
@OdooMates 5 жыл бұрын
Thanks for the comment. We will improve on it :)
@charoliyamujahid526
@charoliyamujahid526 5 жыл бұрын
Explain with code
@OdooMates
@OdooMates 5 жыл бұрын
Its already explained in the Video
@charoliyamujahid526
@charoliyamujahid526 5 жыл бұрын
env['ir.sequece].next_by_code['hospital.patient] or ('new') not explain inside create function code
@OdooMates
@OdooMates 5 жыл бұрын
@@charoliyamujahid526 Okay, see, we are searching the model ir.sequence by the given code to get the next number in sequence
How To Inherit And Add Field to Existing Views In Odoo12
6:27
Odoo Mates
Рет қаралды 45 М.
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 79 МЛН
РОДИТЕЛИ НА ШКОЛЬНОМ ПРАЗДНИКЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,7 МЛН
«Кім тапқыр?» бағдарламасы
00:16
Balapan TV
Рет қаралды 218 М.
ДЕНЬ УЧИТЕЛЯ В ШКОЛЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,8 МЛН
Record Rules in Odoo
19:50
Odoo Mates
Рет қаралды 32 М.
Define New Menu and Actions in Odoo
22:07
Odoo Mates
Рет қаралды 49 М.
How To Add Smart Buttons in Odoo12 (type object)
21:42
Odoo Mates
Рет қаралды 20 М.
How to add new sequence in Odoo
7:18
Cybrosys Technologies
Рет қаралды 2,1 М.
How To Define Search View in Odoo12
10:53
Odoo Mates
Рет қаралды 16 М.
Create a Wizard and Call it in Button Click Odoo
17:51
Odoo Mates
Рет қаралды 34 М.
How to share a React Component with the URL
14:11
Sam Selikoff
Рет қаралды 12 М.
5 missing Vue.js features
18:36
Alexander Lichter
Рет қаралды 4,3 М.
How to Create a New Sequence Field in Odoo
5:36
Kevin Zaki
Рет қаралды 2,8 М.
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 79 МЛН