m_e

1

votes
2

answer
104

views

Singleton Database Class for JDBC Pool using Apache Tomcat JDBC

I am trying to configure a singleton database class to allow connection pooling against Oracle XE 18c database using JDK8 and Tomcat7. I can not compile the source because of the following error: unreported exception SQLException; must be caught or declared to be thrown Class source code: package co...
M.E.
1

votes
0

answer
177

views

Odoo 10 - XMLRPC getting description of a select field

I am retrieving stock.picking record via XMLRPC: record = api.execute_kw(db, uid, pwd, 'stock.picking', 'read', [[1]]) Which returns all fields from the record. Among all fields, I am interested in field state, which can be accessed via: record.state Which contains: done, draft, partially_available,...
M.E.
1

votes
2

answer
1.3k

views

DataTables, filter multiple columns with multiple values

The following page gives an example on how to implement a filter by values on columns. I want to replace the select with a multiple select, so user can filter out more than one value for a specific column, however, I am unsure on how to process the multiple values received by the multiple select. $(...
M.E.
1

votes
0

answer
219

views

Load multidimensional (numpy) array into GPU memory and slice from it - with Keras?

I came across this answer, which explains how one can load a (multidimensional) numpy array as a constant into GPU memory and slice from it (each slice being a potential batch for training) with TensorFlow. I was wondering whether it was possible to do the same with Keras (with TensorFlow backend) a...
s-m-e
1

votes
0

answer
66

views

Odoo 10 - Get translated name

I have a model which points to a product.template instance: In one of the internal methods of the model I am trying to retrieve the name of that pointed instance by doing: self.related_product_id.name Where self.related_product_id in the model is: related_product_id = fields.Many2one( 'product.templ...
M.E.
1

votes
0

answer
45

views

Truncate file with a path relative to a directory/file descriptor?

Many methods of the os module (see documentation) support paths relative to file descriptors (dir_fd), for example the unlink method: os.unlink(path, *, dir_fd=None) I have been relying on this feature in a few cases, though it is not supported for all file-related methods of os. It's missing for tr...
s-m-e
1

votes
0

answer
31

views

Autocomplete doesn't work in IE for large data (>2500)

$(function() { $('[id$=T_MachineNoName]').autocomplete({ maxResults: 25, maxShowItems: 5, delay: 1000, minLength: 1, source: function(request, response) { $.ajax({ url: '', data: '{ 'Factory': '' + document.getElementById('T_FactoryCode').value + '','prefix': '' + request.term + ''}', dataType: 'jso...
1

votes
1

answer
22

views

Writing to local file system in Pentaho Server 8 CE

I have used in development a Text File Output step in Pentaho 8 CE. While using the client local installation, output files are written normally to file system. When I installed the Pentaho Server 8 CE and configured everything to use MySQL as repository, I noticed that system was not writing files...
M.E.
1

votes
1

answer
285

views

how to continue after calling objc_msgSend

I am doing meta-programming with objective-C and try to automate some of an application functions. Thus, I am not changing the source code files and the view controllers of the application but from another file I am managing to get the UI navigation stack and I am using Objective-C Runtime Reference...
m e
1

votes
1

answer
118

views

Need help creating a skeleton for a client portal on DNN

Total DNN noob. I can code some WebForms and MVC, but having no luck finding anything concrete out there about doing what I want in DNN How would I go about setting up a client portal in DNN? I want to have separate areas for the client, including a main dashboard that aggregates content for the cli...
M E Moriarty
1

votes
2

answer
648

views

Stop a clicked link from loading and let the surrounding element with Angularjs ng-click handle the action

I have a table of courses and initially I made each row clickable, which would then switch templates in ng-view and show the course's details. My problem is that I need a search appliance's crawler to be able to follow links to the course's details in order to make them available for searching. I...
m.e.conroy
1

votes
1

answer
484

views

Customize change detection to perform deep object compare instead of reference equals check in Angular2

I've created a filter-pipe to perform filtering for an array of objects. This pipe gets a filterArgs object which contains some properties on which basis the items should be filtered. @Pipe({ name: 'filter' }) export class FilterPipe implements PipeTransform { transform(items: Item[], filterArgs: an...
M.E.
1

votes
1

answer
690

views

Simulating top, bottom, left and right margins in tkinter pack geometry

What should be done to have left_margin (cyan) and right_margin (magenta) frames taking all vertical height from top_margin to bottom_margin? import Tkinter as tk root = tk.Tk() top_margin = tk.Frame(root, height=32, background='red') left_margin = tk.Frame(root, background='cyan') sheet_area = tk.F...
M.E.
1

votes
1

answer
1.6k

views

Set wx.Frame size (wxPython - wxWidgets)

I am new to wxPython and I am finding some issues while seting a given size for both frames and windows (widgets). I have isolated the issue to the simplest case where I try to create a Frame of 250x250 pixels. Running the code I get a window of an actual size of 295 width by 307 height (taking into...
M.E.
1

votes
1

answer
354

views

Odoo 10 - Retrieving the value of invoice sequence

I want to override the unlink method of account.invoice model. Currently this method is: @api.multi def unlink(self): for invoice in self: if invoice.state not in ('draft', 'cancel'): raise UserError( _('You cannot delete an invoice which is not draft or cancelled. You should refund it instead.')) e...
M.E.
1

votes
1

answer
529

views

Odoo 10 - Set the value of next sequence for a IrSequence instance

I need to set the value of sequence for a IrSequence model instance inside a Python method. I would have as input values: the ID of the IrSequence (and getting the ID of the IrSequenceDateRange if dates are used is also possible). the value for the next value to be used in the sequence. Given that I...
M.E.
1

votes
1

answer
415

views

Odoo 10 - Duplicate supplier info for a given product_template

I have: a) given product_template_id (i.e. id 100) and b) a duplicated product_template_id (i.e. id 200) created using copy() method copy() method copies only product.template model, so suppliers for that specific product are not copied. I would like to duplicate all suppliers for that model, but...
M.E.
1

votes
2

answer
309

views

Odoo 10 - Translation

I have developed a custom module, using English for all the records. I want to include a localized translation file for a local language (which happens to be Spanish). I have learnt here in the Odoo doc that I need to export a .PO file using 'New Language (Empty translation template)'. I can read th...
M.E.
1

votes
1

answer
80

views

How to determine whether files have been changed in a directory tree without traversing the entire tree?

Imagine a directory tree (on Linux): [email protected]:~/demo> find . . ./test1 ./test1/test1_a ./test1/test1_a/somefile_1a ./test1/test1_b ./test1/test1_b/somefile_1b ./test0 ./test0/test0_a ./test0/test0_a/somefile_0a ./test0/test0_b ./test0/test0_b/somefile_0b Scenario: I determine all available meta...
s-m-e
1

votes
1

answer
688

views

Odoo 10 - Mail Templates Change Color and Bottom Odoo notice

I am creating a new email template by following this link. However when email is received I get I get more an Odoo message and colored upper and bottom areas with the document reference, logo, and company info How and where can I change the color of the areas and change the bottom notice?
M.E.
1

votes
1

answer
113

views

Matching patterns for folder names in a path, excluding a chunk of the path from matching?

Assume an initial (Unix) path [segment] like /var/log. Underneath this path, there might be an entire tree of directories. A user provides a pattern for folder names using Unix shell-style wildcards, e.g. *var*. Folders following the pattern underneath the initial path [segment] shall be matched usi...
s-m-e
1

votes
2

answer
125

views

Tarantool in Python - how to call auto_increment function

I need to call auto_increment function in Tarantool 1.6 using python client. I have tried without success: database = tarantool.connect('localhost', 3301) s = database.space('customer') s.call('auto_increment','foo') Could someone clarify how to insert a new record with 'foo' as field using auto_inc...
M.E.
1

votes
1

answer
50

views

What is a pythonic way of running a Python routine as another user (e.g. root)?

In the spirit of this answer ('Don't call shell commands from Python. You can do everything in Python that shell commands can.'), which is rather common advise given to many people, how do I run a selected individual routine (and ONLY this routine) within a Python program as another user, e.g. root,...
s-m-e
1

votes
1

answer
115

views

Odoo 10 - Retrieve image from product_template

I am trying to get the image of a given product in Odoo 10. Specifically, I want to retrieve the image object from a product_template record in order to copy it to another product_template record. I have tried the following code without success: self.env['product.template'].search([('id', '=', produ...
M.E.
1

votes
1

answer
22

views

jQuery: Hide/Show divs based on an arbitrary number of checkboxes

I have the following code. Borrador Cancelado Esperando Parc. Disp. Confirmado Asignado Hecho Div1 Div2 Div3 Div4 Div5 Which contains a set of checkboxes, each checkbox has a certain initial state (checked/not checked) and a value. They can have assigned a name if needed. The there is an arbitrary n...
M.E.
1

votes
1

answer
41

views

Play Sound and alert

I want to play a small beep in my web application and then launch an alert message. I therefore do: if(_none_valid) { $.playSound('/static/wav/beep_error.wav').delay(300); alert('ERROR: Not found.'); } What happens is that the .wav file is played AFTER the user has dismissed the alert. I have tried...
M.E.
1

votes
1

answer
290

views

Odoo 10 - Split taxes in sale order

When products have different taxes (i.e. different VAT % values), Odoo group everything when displaying the tax in the total. How can I get the subtotals for each tax (i.e. VAT 10%, VAT 20%, etc.)?
M.E.
1

votes
1

answer
178

views

Odoo 10 - Qweb iterate over all sale order lines and calculate total weight

I would like to iterate over all sale order lines and multiply product_uom_qty by product_id.weight for each product, then sum up all values to get the total weight of the sale order. I have seen a construct like this in sale order template: Which would be the equivalent to perform such aggregated m...
M.E.
1

votes
1

answer
216

views

Qweb how to select records with non-null field

I have a QWeb report where object o is stock.move(97,99,98,325,326,327) so displays stock.move(97,99,98,325,326,327) In database, from all those stock.move elements, only three of them have populated the field procurement_id: # select id,procurement_id from stock_move where id in (97,98,99,325,326,3...
M.E.
1

votes
1

answer
199

views

Odoo 10 - QWeb Barcode generator, EAN13 missing leading zero

I have a product with the following barcode, which can be accessed in the QWeb report as o.barcode: 0200000100094 I use the following syntax to generate the barcode in a QWeb report: However, Odoo QWeb prints barcode with 12 digits, i.e. it prints: 200000100094 I guess somehow o.barcode is being ide...
M.E.
1

votes
1

answer
282

views

Grav - Pass JSON data from Plugin to Twig

I want to retrieve a JSON from a webservice and incorporate it into a Twig template. I went through the docs and I found that I could use this option. I have followed the steps from the doc and I have prepared this plugin: /var/www/html/grav/user/plugins/category# ls category.php category.yaml twi...
M.E.
1

votes
1

answer
102

views

Grav - Parse URL

I want to define a new template called 'product'. This template calls an external service and retrieves the information about that specific product. That is easily done with a custom plugin that access the product information. Information on how to do that has been found here. However, I would like...
M.E.
1

votes
1

answer
24

views

CSS - How to debug active/selected input elements in Google Chrome

I am modifying an existing template to adapt some basic parameters such as colors etc. I use Google Chrome development extension so I can right click on a particular element use Inspect option to see what CSS rules are being applied to that element. Then I can override specific rules in my custom CS...
M.E.
1

votes
1

answer
76

views

How do I convert a string into a formatted string literal at run-time?

I am working my way through PEP 498. Maybe I do not quite get the concept, but how could I possibly convert a regular Python string into a formatted string literal and evaluate it at run-time? Imagine you have a string: some_string = 'Name: {name}' If it was a formatted string literal, the following...
s-m-e
1

votes
1

answer
28

views

gnuplot - How to rescale xaxis but using the same dataset

I have the following CSV data: -140,0 -139,0 -138,0 ... -4,240 -3,609 -2,1426 -1,7352 +0,624209 +1,7269 +2,1376 +3,553 ... +138,0 +139,0 +140,0 And the following gnuplot command: set terminal x11 set xrange [-10:10] set auto y set datafile separator ',' set xtics 1 plot 'histogram1min.csv' using 1:...
M.E.
1

votes
3

answer
54

views

Arduino infiniti tone

I am making a smoke detector. When it detects smoke iz should alert with buzzer. Is there any way I could make it to buzz forever until external interupt such as restart pin? Or could I yust remove timing from tone() function. Here is the code I use. int sensorValue; int digitalValue; int green = 8;...
M.E. Team
1

votes
1

answer
37

views

How to invoke a backend function in JS in a Smarty template used in a Prestashop module?

In a custom prestashop module, I am trying to dynamically show children categories in a dropdown. This is the code I add in the hook before calling the template: $subcatObj = new Category('24'); $subcatObj2 = $subcatObj->getSubCategories($this->context->language->id); $this->context->smarty->assign(...
M.E.
1

votes
1

answer
256

views

How to use seo friendly URLs in a custom controller in Prestashop 1.7

I have a custom module defined in a Prestashop 1.7.1.1 installation. This module defines a new category page adding custom functionality and layouts. Category 1034 represents Foo Brand and can be accessed both by: https://www.example.com/module/categorypage/subcategory?id_category=1034 and its seo f...
M.E.
1

votes
1

answer
0

views

Getting erratic runtime exceptions trying to access persistant data in multiprocessing.Pool worker processes

Inspired by this solution I am trying to set up a multiprocessing pool of worker processes in Python. The idea is to pass some data to the worker processes before they actually start their work and reuse it eventually. It's intended to minimize the amount of data which needs to be packed/unpacked fo...
s-m-e
1

votes
1

answer
0

views

Understanding memory consumption in PonyORM with SQLite

I have the following code which loads a large CSV file (more than 3.5 million rows) into a SQLite database. The program works fine but it seems that it does not free memory so while running the program I can see with command top how its memory size grows until it exhaustes all available server memor...
M.E.

View additional