odoo-9

Odoo 9.0C: How can i access the value of a many2one field (that has been created in sale.order.line module on the invoice qweb report?

末鹿安然 提交于 2019-12-08 12:52:31
问题 I have installed module Sale Sourced by Line by Camptocamp, Eficent, SerpentCS, Odoo Community Association (OCA) for Odoo 9.0. The module creates a new many2one field as the code bellow: class SaleOrderLine(models.Model): _inherit = 'sale.order.line' warehouse_id = fields.Many2one( 'stock.warehouse', 'Source Warehouse', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="If a source warehouse is selected, " "it will be used to define the route. "

How can i generate xls report in odoo

ぐ巨炮叔叔 提交于 2019-12-08 12:15:35
问题 I want to generate my own excel report using Excel report engine in odoo 8. someone please send me a simple excel report sample or any helping URL. I'll be very thankful to you .... 回答1: Here is a simple piece of code. There is really a lot of examples on the internet with good explanations. I suggest you go through the code in detail to see how it works (by the way I have copied the code also from somewhere - I cannot remember where. Also have a look at the examples here:https://github.com

auto increment - internal reference odoo9

本小妞迷上赌 提交于 2019-12-08 11:05:59
问题 I want to change the type of the field 'ref' (Internal Reference) to be auto incremented (for example every time I create a new contact my Internal Reference should increase by 1). So first contact should have Internal Reference 1, the second 2, the third 3 and so on... There are no errors but still the reference field is empty. Have I missed some additional code? Can someone help me? @api.model def create(self, vals): if vals.get('ref', 'New') == 'New': vals['ref'] = self.env['ir.sequence']

Odoo - Combine two fields heading in one2many

久未见 提交于 2019-12-08 07:54:52
问题 I am working with odoo 10-e. I created custom module and in that module i want to show one2many records like this ---------------- | Long Cell | ---------------- | 1 | 2 | ---------------- right now by default each column have its own heading which is actually string= value. I want to override default behavior. 回答1: First create the xml file which extends the ListView Template like this to add colspan feature in base list view template. colspan.xml <?xml version="1.0" encoding="UTF-8"?>

Odoo - Cannot loop through model records

怎甘沉沦 提交于 2019-12-08 07:42:45
问题 I want to call a method every time my module gets installed or updated. Inside that method I want to loop through model records, but I'm only getting different errors. This documentation looks pretty straightforward: https://www.odoo.com/documentation/9.0/reference/orm.html But it doesn't work for me. I'm getting this error: ParseError: "'account.tax' object has no attribute '_ids'" while parsing This is how I call the method: <openerp> <data> <function model="account.tax" name="_my_method" /

Pass custom field values from oppertunity to quotation in odoo 10

徘徊边缘 提交于 2019-12-08 07:27:52
问题 I have added a custom field in opportunity and same field in quotation and I want to add value in that custom field in opportunity and pass that values to Quotation in same field. In odoo 8 it was done by overriding makeOrder method but now in odoo 10 I have no idea how to do it. Someone please help me about it. Thanks! 回答1: When you write your field definitions, you can solve it. It will be change on the fly, if you set 'store' property to True, then it will write it to the db, so this will

Change message order in discuss odoo 9

别等时光非礼了梦想. 提交于 2019-12-08 07:22:35
问题 I can't find where change message order in discuss module in odoo9 Where is location form and class from this image --> https://postimg.org/image/xffsxqqkf/ 回答1: Open addons/mail/static/src/js/thread.js line 59 inside the init function of the thread widget. The display_order is set as ASC . You only have 2 options there. For a specific order you have to extend this widget in order for you to define: 1) How will the order be determined, 2) When your order will be applied, on all the o_mail

Odoo - View customization with colspan or may be col

不羁的心 提交于 2019-12-08 04:45:03
问题 I am using odoo 10-e . Earlier i asked a question how can we merge two or multiple header to show one header against multiple fields Combine two fields heading in one2many . So answer was good and it worked but now i want to do some more customization in the one2many tree view in form. I want something like this. I want borders also in rows but for specific columns and also sub heading for only once per column. I tried to add div in odoo view but its not supported. I also tried to add it

How to make odoo custom stock move (odoo v8 and v9)

走远了吗. 提交于 2019-12-08 04:32:36
问题 I am creating a custom module. There is an one2many field. It has - quantity unit of measure source location destination location I need to transfer the product from source location to destination location. In odoo v8 I saw two functions - def do_detailed_transfer(self) and do_transfer() But do_detailed_transfer is not available in odoo v9. How can I create a custom stock move which will transfer products from source location to destination location for both versions? Thanks. 回答1: I am able

Odoo javascript onclick event

烈酒焚心 提交于 2019-12-08 03:30:56
问题 Is it possible create my own button and this button click call javascript function? Like simple onclick javascript method? If the answer is yes, how can I do that? I want to use "Add an item" button or create my own button that calls the same function like I click on "Add an item" button. 回答1: First Create button where ever you want to create with some modifications. <button string="Click" custom="click"/> Then create one JS file that will contain following code. odoo.define('YOUR_MODULE