I just can't find any info on this!!!
Please see the image. I want to capture the "number" from the user response as a variable (property) but can't see how to. Any ideas?!
I want to be able to do this within the composer, not with code. Surely #prebuilt number is storing the recognized entity - how do I set a variable (property) to the value of the entity? Thanks.
Here's the image of my issue
LOL - solved! The answer is to use coalesce. Keeping it here for reference for others.
Solution
I have a customer entity of type PanacheEntityBase. I would like get all customers by ids
I can get it with customer.list("customerId", id) in a loop. I dont think its a good solution. I prefer using IN. Please suggest how to use IN with PanacheEntityBase
I solved the problem with customerEntity.list("customerId IN (?1)", customerIds);
Note: customersids must be a java list (Array did not work)
O = discord.PermissionOverwrite()
O.manage_webhooks=True
User=get(ctx.guild.members, name="User1")
await chan.set_permissions(User, overwrite=O)
What I'm doing wrong?
I get no errors but the channels permission for the member doesn't change.
Help me please.
First, there's a built in method called get_member that I strongly suggest you use, simply using a user name is pretty easy to get messed up as someone could just change their name. But it seems your code is rather sound, so some more information (if you need to use user name) such as how you're calling this and what get exactly is would help a ton!
Here is the screenshot of the warning which is apperaing while creating customers
I am not able to create new customers in odoo.
Initially I have done some customization in my module ...after that customization my code worked absolutely right, I have created new customers also..but after I dont know why i am not able to create new customers...
please suggest me some solution.
Thank you
I've had a similar problem related to a customized module in Odoo 10. I did some pretty thorough research and the Odoo ORM is doing some things it probably shouldn't be and that I'm not smart enough to sort out.
The sections in the Odoo 10 ORM API Documentation about creating models and fields were kind of helpful, but the documentation on the ORM is severely lacking and in some cases incorrect.
I eventually fixed it by doing the insert manually with the self.env.cr psycopg2 cursor available in the model's custom methods.
That would look something like the
from odoo import models
class your_class(models.Model):
def custom_create_method(self):
self.env.cr.execute("""
INSERT INTO customer_model_name
(name, value, other_value)
VALUES
('{}', '{}', '{}')
RETURNING id;
""")
new_id = self.env.cr.fetchone()
This has the disadvantage of introducing the possibility of an SQL injection attack into your code, so you'll need to be careful of that.
This is definitely not the ideal solution, but it does work. I believe the problem to be related to the Odoo ORM's handling of computed fields, but that is just a not-really-all-that-educated guess at what's going on.
Hope this helps.
For some reason we found a pattern where we had to comment out one of the dependancies, reinstall/update the module in question, then put it back in. In this case it was res in the custom module's __manifest__.py
i.e.:
'depends': ['base', 'res', 'sale_management', 'account', 'account_payment'],
#'depends': ['base', 'sale_management', 'account', 'account_payment'],
Becomes:
#'depends': ['base', 'res', 'sale_management', 'account', 'account_payment'],
'depends': ['base', 'sale_management', 'account', 'account_payment'],
Then install, see if the error goes away, then shut down the server and flip the comment again
Hey, i've been looking around for a ajax dropdown sorter for my Views in Drupal.
Unfortunatly, i haven't found alot of usefull information about this subject.
Can anyone tell me if theres a solution already available or can help me started on a custom module by telling me which hooks i should use?
I had a similar issue. Unfortunately I wasn't able to sort the data from the database which is by far the best way. I was however able to take the data and sort it with PHP using a preprocessor function. Depending on the name of your view, setup a function similar to the following:
function templatename_preprocess_name_of__view(&$vars)
{
//Super sweet sorting code goes here
}
The name of your view needs to follow the name of the template file that it is driven by, if there isn't on you should create one. Make sure to change dashes to underscores in your function name. Hope this is helpful. If you find a way to do it from the DB I'm all ears because that would be super awesome.