Questions tagged [computed-field]
84 questions
1
vote
2 answers
Combine (compute) fields in XForms itemset
I have an instance with a list of artists
Elvis
Presley
…

j_maly
- 1,091
- 1
- 13
- 27
1
vote
1 answer
Using Drupal 7 Computed Field to provide Date Field Token
In Drupal 7, I have an Event content type. When saved, I want it's URL to be /calendar/day/{yyyy-mm-dd}/{title}, where {yyyy-mm-dd} is based on field_event_date. The Token module can do this for create & change date fields, but not for a custom…

Erik Britt-Webb
- 41
- 5
0
votes
1 answer
Drupal 7 Computed field
I am learning Drupal 7 computed field. According to web sources they say i should use $entity instead of $node for Drupal 7.
I have a content type product with custom fields field_price and field_discount. I need a computed field field_finalprice =…

Balaji
- 31
- 2
- 4
0
votes
0 answers
Create a field that displays how many items are in each stage in Odoo
I created a module in odoo community edition that works with invoices. Invoices have different stages of progress. I created a tab that shows these stages of invoices: draft, awaiting approval, done. How to create a field in list view that will…

Boris Veselov
- 1
- 1
0
votes
0 answers
Issue with Recomputing compute_recent_customer Method in Odoo 15 Custom Module
I am facing an issue with recomputing the compute_recent_customer method in my custom module for Odoo 15. The method is decorated with @api.depends and depends on the recent_order_days field, as well as other related fields. However, despite trying…

souttawther
- 23
- 7
0
votes
0 answers
Use Prisma ORM for computed select between two fields
I have two unsigned int fields in my DB.
I want to run a query that returns a division between those fields using Prisma ORM.
SELECT CAST (COALESCE(total_1/count_1, 0) + COALESCE(total_2/count_2, 0) AS SIGNED) AS
avg_amount FROM table_name WHERE…

amiregelz
- 1,833
- 7
- 25
- 46
0
votes
0 answers
Drupal Computed field module and database
It is posible to get data from database and insert into fiel using computed field module?
I create computed field_a and in custom module put this:
function computed_field_field_a_compute($entity_type_manager, $entity, $fields, $delta) {
$res =…

Mariusz
- 1
- 1
0
votes
2 answers
I want to create a computed column based off a substring of another column in SQL
I have a column called TAG_
Data in the TAG_ column could like the below:
STV-123456
TV-12456
ME-666666
I want to create two computed columns
One that shows the first part of TAG_ before the hyphen
STV
TV
ME
One that shows the second part of TAG_…

Drafter-SQL
- 51
- 6
0
votes
0 answers
Display thumbnail of page when displayed in website search results
Our client wants to display a thumbnail of a screenshot of a page when listed in the search results of the website. Of course, they want it to be automated. The website is build on Sitecore 9.0 and uses SOLR for indexing. It seems that creating a…

pelican_incident
- 41
- 5
0
votes
2 answers
Odoo 11: How to correctly implement @api.onchange?
I want to compute a telephone number, if the number in the 8 position is either "0" or "1" I want to print just the last 4 numbers with a "(3)" before them, otherwise just print the 4 numbers, but what is happening is that my code is printing…
0
votes
1 answer
Create an SQL computed column
I need some help trying to create a computed column that references another table.
Table1 example (Consoles):
Console Games GameCount
PS4 Y 3
Switch Y 5
Xbox Y 2
Table2 example (Games):
GameName …

neptr
- 17
- 4
0
votes
1 answer
can not add compute method
the issue is simple, I just need to create a computed field. here is what I have:
class MyModel(models.Model):
_name = 'my.model'
a = fields.Float()
b = fields.Float()
value = fields.Float(compute='_compute_value')
…

Bashir
- 2,057
- 5
- 19
- 44
0
votes
1 answer
How to insert data in derived columns SQL
I have a view which contains a derived column, and I need to create a stored procedure which make an insert into the view
I've tried
CREATE PROCEDURE INSERTInVIEW
(
@ID DECIMAL(10,2),
@Name ....,
@Address....,
@Phone
)
AS
BEGIN
…

Orsi
- 545
- 2
- 10
- 27
0
votes
2 answers
When, why and how to avoid KeyError in Odoo Development
I´ve noticed that some custom modules that I develop can be installed on databases with records, while others throw the KeyError message, unless the database is empty (no records). Generally the errors appear when the module contains computed…

Simon Capriles
- 143
- 2
- 21
0
votes
1 answer
how to run odoo combuted field on all records?
hello everyone i haved been added an filed called employee_id, it gets the record id as the employee id computed field,
it worked well when any of depending fields change
but i need to run the function on all old date not while creating a new…

Mohamed Fouad
- 476
- 9
- 27