openerp

Computed many2many field dependencies in Odoo 10

隐身守侯 提交于 2019-12-11 05:11:37
问题 I am trying to create a new field on the sale.order.line model. This field is called x_all_route_ids , and is meant to contain all of the available stock.location.route for an Order Line. It should look up the product_id.route_ids and product_id.routes_from_categ_ids for the Order Line, and join them together into a single set of Routes. I am trying to set this field up through the Odoo UI, but getting error related to my "Dependencies". I have Dependencies defined as: product_id, product_id

how get id with onchange for filtering

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:36:55
问题 how can i retrieve the value of a many2one field or its ID from another model for exemple: class Contrat(models.Model): _name = 'facturation.contrat' contrat_parent_id = fields.Many2one('facturation.contrat', string='Numéro Contrat Client', domain=[('is_prestataire', '=', False)]) class Lot(models.Model): contrat_id = fields.Many2one('facturation.contrat', ondelete='cascade') articlecontrat_ids = fields.Many2many('facturation.articleouvrage',string='Article Lot') 91/5000 i want that when i

OpenERP 7 Access Rights for User Roles

喜你入骨 提交于 2019-12-11 04:33:39
问题 I need to add users for my module and need some menuitem restriction for them.mainly i created user and manager roles.in Settings -> Users -> create user -> Access Rights and i change User or Manager.but no affect for that user and not shows any menu items to them.main menu item also not shows. I added code in bpl_security.xml and that xml file mapped in openerp.py file. is anything missing to me.?please check my code and advice <?xml version="1.0" ?> <openerp> <data> <record model="ir.module

How do I get the value from a form field using Odoo?

不问归期 提交于 2019-12-11 03:38:35
问题 I have this field in a form view: <field name="value"/> I want to get the value from the field when someone wants to add a new value, the way that I might do $_GET['value'] in PHP. Simple example: I want, when the user inserts a value, for the program to check if it is greater than sum of all values and print an error message like: Cannot add the value because it is greater than the sum of all values I've written this so far: view.xml <?xml version="1.0" encoding="utf-8"?> <openerp> <data>

How to use the dot notation in a kanban view in Odoo?

爱⌒轻易说出口 提交于 2019-12-11 03:29:51
问题 I have a model customer and another model company . The model customer has a field named company_id , which is a Many2one pointing to company . Besides, company has a field of type Char named trade_name . Now, I'm creating the kanban view of customer , using Qweb . What I want is to show the trade name of the company of each customer. <t t-field="company_id.trade_name"/> That line is not working, I get a blank space in the kanban view where the field should be. I also tried with t-esc , and

OpenERP @http.route('demo_json', type=“json”) URL not displaying JSON Data

时间秒杀一切 提交于 2019-12-11 02:48:18
问题 I am create controller in OpenERP Framework. Following is my code and i set http.route type="http" , import openerp.http as http from openerp.http import request class MyController(http.Controller): @http.route('demo_html', type="http") def some_html(self): return "<h1>This is a test</h1>" Above code work perfect once i login into openerp after i modify URL http://localhost:8069/demo_html show me return result This is a test in h1 heading tag. But same way i try to type="json" and add

client web - how to get current record id at any time

爷,独闯天下 提交于 2019-12-11 02:21:28
问题 I'm trying to work on the "different permissions based on workflow state" issue but I'm struggling with the fact that it seems impossible to get the id of the current object 'at any time' that is necessary in order to get the permission of that object. What I mean is that I manage to get it from the client state following jquery bbq docs like: $.bbq.getState().id BUT it looks like this is doable only AFTER a complete page load. I investigated this by placing some alert in the main view events

Is it possible to show an One2many field in a kanban view in Odoo?

╄→гoц情女王★ 提交于 2019-12-11 02:02:03
问题 I would like to know if it's possible to show a One2many field in a kanban view in Odoo (note that I'm not talking about Qweb in templates or reports, only about Qweb in kanban views). I have a model which has a One2many field named other_contact_ids . I want to show the name of each contact in the kanban view: <t t-foreach="record.other_contact_ids.raw_value" t-as="contact"> <p> <t t-esc="contact.name"/> </p> </t> I'm getting an error, because the t-as is storing only the ID of the objects

Datetime and Time Zones - OpenERP 7

狂风中的少年 提交于 2019-12-11 01:14:21
问题 I'm keeping the current date in a model using a datetime field in which I am indicating default to take the current date as a value. _defaults = { 'f_inicio' : lambda *a: datetime.now().strftime('%Y-%m-%d %H:%M:%S'), } Assuming that the current date is '07/10/2013 17:24:05 ', in the view is the date '07/10/2013 12:24:05' and rectified in the database and the date is '07/10/2013 17:24:05'; gather that this subtracting five hours. The user can set the time zone 'America/Bogota', Colombia is in

Odoo POS create a dropdown list

六眼飞鱼酱① 提交于 2019-12-11 00:59:44
问题 Can anyone help me with creating a dropdown list in the POS partner screen. I added this in the pos.xml file, but the dropdown is empty. Thanks <div class='client-detail'> <span class='label'>CustomerGroup</span> <select class='*what to place here?*' name='group_id'> <option value=''>None</option> <t t-foreach='*what to place here?*' t-as='group'> <option t-att-value='group.id' t-att-selected="partner_group_id ? ((group.id === partner.group_id[0]) ? true : undefined) : undefined"> <t t-esc=