Odoo attributeError: 'bool' object has no attribute 'get'

Odoo attributeError: 'bool' object has no attribute 'get'

attributeerror: module 'odoo.api' has no attribute 'one'
attributeerror type object has no attribute in odoo
object has no attribute 'env'
odoo apps
attributeerror: module has no attribute
odoo fields
odoo documentation
attributeerror object has no attribute odoo

I'm trying to create a dependence between two fields. The status field and the user_id field. I have this issue with many states. What I want is that when the issue is confirmed the field Assigned to appears. Then when I assign the issue to someone, the state changes automatically from Confirmed to Assigned. So I created this python code:

class ProjectIssue(models.Model):
    _name = "project.issue"
    _description = "Project Issue"
    _inherit = "project.issue"

    state = fields.Selection([('new', 'New'),
                           ('feedback', 'Feedback'), 
                           ('acknowledged', 'Acknowledged'), 
                           ('confirmed', 'Confirmed'), 
                           ('assigned', 'Assigned'), 
                           ('testing', 'Testing'), 
                           ('resolved', 'Resolved'), 
                           ('closed', 'Closed'), 
                            ], string='Issue Status', default='new')

    def action_back_to_new(self):
        return self.write({'state': 'new'})
    def action_upgrade_to_feedback(self):
        return self.write({'state': 'feedback'})
    def action_back_to_feedback(self):
        return self.write({'state':'feedback'})
    def action_acknowledge(self):
        return self.write({'state':'acknowledged'})
    def action_confirm(self):
        return self.write({'state':'confirmed'})

    @api.onchange('user_id')
    def action_upgrade_to_assigned(self):
        return self.write({'state':'assigned'})

And this is the xml code:

    <record id="project_issue_form_view_2" model="ir.ui.view">
          <field name="name">project.issue.form</field>
          <field name="model">project.issue</field>
          <field name="inherit_id" ref="project_issue.project_issue_form_view"/>
          <field name="arch" type="xml">
            <field name="stage_id" position="replace">
                <button name="action_confirm" string="Confirm" type="object" states="acknowledged" class="btn-primary"/>
                <button name="action_back_to_feedback" string="Back to Feedback" type="object" states="acknowledged" class="btn-primary"/>
                <button name="action_back_to_new" string="Back to new" type="object" states="feedback" class="btn-primary"/>
                <button name="action_acknowledge" string="Acknowledge" type="object" states="feedback" class="btn-primary"/>
                <button name="action_upgrade_to_feedback" string="Upgrade to feedback" type="object" states="new" class="btn-primary"/>
                <field name="state" widget="statusbar"/>
            </field>
            <field name="priority" position="replace">
                <field name="ipriority"/>
            </field>
            <field name="user_id" position="replace">
                <field name="user_id" attrs="{'invisible': [('state', 'in', ['new', 'feedback', 'acknowledged'])]}"/>
            </field>
          </field>
     </record>
    </field>

When I run this code and change user_id this error appears:

     File "C:\Users\PC\git\odoo\odoo-10.0\odoo\http.py", line 935, in __call__
return self.method(*args, **kw)
     File "C:\Users\PC\git\odoo\odoo-10.0\odoo\http.py", line 506, in response_wrap
response = f(*args, **kw)
     File "C:\Users\PC\git\odoo\odoo-10.0\addons\web\controllers\main.py", line 885, in call_kw
return self._call_kw(model, method, args, kwargs)
     File "C:\Users\PC\git\odoo\odoo-10.0\addons\web\controllers\main.py", line 877, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
     File "C:\Users\PC\git\odoo\odoo-10.0\odoo\api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
     File "C:\Users\PC\git\odoo\odoo-10.0\odoo\api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
     File "C:\Users\PC\git\odoo\odoo-10.0\odoo\models.py", line 5494, in onchange
record._onchange_eval(name, field_onchange[name], result)
     File "C:\Users\PC\git\odoo\odoo-10.0\odoo\models.py", line 5393, in _onchange_eval
process(method_res)
     File "C:\Users\PC\git\odoo\odoo-10.0\odoo\models.py", line 5370, in process
if res.get('value'):
    AttributeError: 'bool' object has no attribute 'get'

Thank you for your help.


you need to remove return in def action_upgrade_to_assigned

How can I solve this AttributeError?, it in hr_timesheet_sheet.py When I click the button it says: AttributeError: '​hr_timesheet_sheet.sheet' object has no attribute 'button_cancel'. Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.


Probably, the error is related to the onchange method.

return self.write({'state':'assigned'}) => This process return a boolean result.

I had the same sitution when I was doing this:

    @api.onchange('date_to')
    def _onchange_date_to(self):
        date_from = self.date_from
        date_to = self.date_to
        if not (date_from or date_to):
            return True

The problem was solved by fixing "return True" as "return".

Good Luck !

AttributeError: module 'odoo.api' has no attribute 'multi', While installing my first new custom module in Odoo 13, got following error : AttributeError: module 'odoo.api' has no attribute 'multi' Impacted versions: 11.0 Steps to reproduce: Run a database containing website_sale_stock module browse() and read() a product.product object Current behavior: When the read() method is called it throws next error: Error: Odoo Server Erro


The returned value of onchange method is wrong because Odoo is expecting a dict and you return the result of write method which is a boolean.

[SOLVED] AttributeError: 'module' object has no attribute, Hey everybody Today I started to migrate the module 'Terms and Conditions' ( https://www.odoo.com/apps/7.0/agaplan_terms_and_conditions/  Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more AttributeError: 'bool' object has no attribute '_fields' - Odoo v8


AttributeError: object has no attribute, 1 Answer. In your case basically the issue is comes because of you have not upgrade your customized module properly and may be with not to restart the odoo server form the terminal after creating your method. please try to check restart the odoo server and then check the affect within that module action. Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc. Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.


How To Fix Type Object Has No Attribute Error in Odoo, Please try again later. Published on Aug 27, 2019. Steps to fix the type object has no attribute Duration: 2:07 Posted: Aug 27, 2019 (AttributeError: 'bool' object has no attribute 'split'), pero supongo que es lo esperable, y que no debería volver a intentar. — Reply to this email directly or view it on GitHub #1 (comment). Coop. de Trab. Moldeo Interactive Lmt. Cristian Sebastian Rocha Consultor Analista. Bonpland 2363 Of 303 (C1425FWE) CABA, Argentina. (+54-9-11).6800.0269


[11.0] AttributeError: module 'odoo.fields' has no attribute 'Serialized , [11.0] AttributeError: module 'odoo.fields' has no attribute 'Serialized' #177. Closed. mrddter opened this issue on Apr 4, 2019 · 3 comments. Closed