odoo-10

How do i make and attache action to button

久未见 提交于 2019-12-11 05:59:51
问题 Hello I have created a button on my Odoo 10 form "SET geprint" now i want to attach an action to the button. If i press the button the value of the boolean geprint must change to 1. How can I make this possible? If possible i would also like to create that button in the list view to update multiple records. Thx for your help I tried your code but i am getting the following error now (name field to update is x_geprint) button code : 回答1: You can do it via following methods . Create object type

How to Dynamic change paper format margins (Left, Right, Top, Bottom)?

百般思念 提交于 2019-12-11 05:26:39
问题 I want to change my report paper size dynamically while printing pdf report. Like I have type in my object. When type change then, I want to change my report margin(top, bottom, left, right) which value configure as per margin. Thanks for your valuable help 回答1: You can override the method that calls wkhtmltopdf and manipulate the parameters passed there. See odoo.addons.report.models.report.get_pdf function. You can override this, check your variable and call _run_wkhtmltopdf with different

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 to check if field 'contains' the value in Odoo

眉间皱痕 提交于 2019-12-10 20:28:37
问题 I'm trying to provide an access for users, who're viewers of the given category. <record id="rule_cost_centre_viewer" model="ir.rule"> <field name="name">Access for the records for a cost_centre's viewer</field> <field name="model_id" ref="model_example_module"/> <field name="domain_force">[('user_id', 'in', category.viewers.ids)]</field> <field name="groups" eval="[(4,ref('group_example_module_user'))]"/> </record> The attempt was not successful, I got: ValueError: <type 'exceptions

Odoo 10 add button to POS

血红的双手。 提交于 2019-12-10 20:27:44
问题 I am trying to add a button to the POS screen. A lot of the information I have for this is related to Odoo 8 and this is probably why it is not working. I installed the custom addon without any errors but I don't see the button. I don't get any errors when running the POS either. In version 8 there is a widgets.js file which includes module.PosWidget.include({ build_widgets: function(){ var self = this; this._super() There is no widgets.js in version 10 and I am guessing this is where my

Product and product template in Odoo 10

孤者浪人 提交于 2019-12-10 18:56:07
问题 What is the need for two different tables for Product Master in Odoo ? How product.product and product.template differ ? 回答1: Odoo has two models/tables for products because of product variants: product.product contains variant level information. product.template contains information that is same to all variants. You can use product variants in Odoo by turning on "Products can have several attributes, defining variants" in Sales / Settings. With variants the product.template contains the main

How to remove implied ids from group in odoo?

て烟熏妆下的殇ゞ 提交于 2019-12-10 17:28:02
问题 I am trying to remove implied ids of purchase user group . This is actual group in purchase order <record id="group_purchase_manager" model="res.groups"> <field name="name">Manager</field> <field name="category_id" ref="base.module_category_purchase_management"/> <field name="implied_ids" eval="[(4, ref('group_purchase_user'))]"/> <field name="users" eval="[(4, ref('base.user_root'))]"/> </record> Then I am trying to remove implied of the group in my custom module <record id="purchase.group

How to add an external jQuery plugin to the list view on Odoo?

妖精的绣舞 提交于 2019-12-10 16:09:07
问题 I am using Odoo 10e. I want to integrate a jquery plugin into my module. I want to integrate the jQuery plugin jquery-resizable-columns. It simple helps user to resize columns of table on the fly and I want to apply this on a specific model's list view Which method should I extend in order to add the plugin? 回答1: I think you should extend (maybe include) some widget in the web module. If you go to the file /addons/web/static/src/js/view_list.js , you can see the widget that renders the table:

how to filter tree view with dynamic field odoo-10

那年仲夏 提交于 2019-12-10 15:29:24
问题 i added 'location_id' field to res.user to connect user to a certain location class ResUser(models.Model): _inherit='res.users' current_location_id=fields.Many2one('physical.location',string="Current Loction") allowed_location_ids=fields.Many2many('physical.location',string="Allowed Location") i wanted to filter only the visits with current_location_id = user_current_location_id <filter string="My visits" name="filter_my_visits" domain="[('current_location_id','=',current_location_id)]"/>

Why are my tests not running on Odoo 10?

本小妞迷上赌 提交于 2019-12-10 14:18:41
问题 I created a simple to-do application with the following structure: todo_app ├── __init__.py ├── __manifest__.py ├── tests │ ├── __init__.py │ └── tests_todo.py └── todo_model.py Under the tests folder I have: tests/__init__.py : # -*- coding: utf-8 -*- from . import tests_todo tests/tests_todo.py : # -*- coding: utf-8 -*- from odoo.tests.common import TransactionCase class TestTodo(TransactionCase): def test_create(self): """ Create a simple Todo """ Todo = self.env['todo.task'] task = Todo