Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

AttributeError: 'bool' object has no attribute 'get' openerp

Subscribe

Get notified when there's activity on this post

This question has been flagged
errortaxaccount.invoiceurgentmethod
14069 Views
Avatar
evon_dun

Hi, i created few fields to my account.invoice, and i am trying to update these fields with a function. I get this error: AttributeError: 'bool' object has no attribute 'get' openerp. Please help its really very urgent, account_invoice.py", line 844, in button_reset_taxes. My fields:

'vat13_5':fields.float('13.5%',digits_compute=dp.get_precision('Account')),
'vat5':fields.float('5%',digits_compute=dp.get_precision('Account')),
'others':fields.float('Others',digits_compute=dp.get_precision('Account')),
'sales_vat13_5':fields.function(_tax_base_amount,

type= 'float',string = 'Sales 13.5%', digits_compute=dp.get_precision('Account'),method = True, store = True), 'sales_vat5':fields.function(_tax_base_amount, type= 'float',string = 'Sales 5%', digits_compute=dp.get_precision('Account'),method = True, store = True), 'sales_others':fields.function(_tax_base_amount, type= 'float',string = 'Sales Others', digits_compute=dp.get_precision('Account'),method = True, store = True),

the fields vat13_5, vat5, and others already have values in them.

the function which i am using :

> def
> _tax_base_amount(self,cr,uid,ids,name,args,context=None):
>     res = {}
>     tax_obj = self.pool.get('account.invoice.tax')
>     for invoice in self.browse(cr,uid,ids,context=context):
>        res[invoice.id] = {
>                          'sales_vat13_5':0.0,
>                          'sales_vat5':0.0,
>                             'sales_others':0.0,
>                        }
>         base1 = 0.0
>         base2 = 0.0
>         base3 = 0.0
>         name13_5 = 'Vat13.5%'
>         name13 = '13.5% - Vat13.5% E'
>         name5 = 'Vat  5 %'
>         name5E = '5% E - Vat 5% E'
>         namecst2 = 'CST 2% '
>         namecst2E = '2% - CST 2% E'
>         namevat2 = 'Vat 2% ( 3B )'
>         namevat2E = '2% - Vat 2% ( 3B ) E'
>         namecst5 = 'CST 5% Without form C '
>         namecst5E = '5%  - CST 5% Without Form C E'
>         namecst13_5 = 'CST 13.5% Without form C '
>         namecst13_5E = '13.5%  - CST 13.5% Without Form C E'
>         namecst= '5% - CST 13.5% Without Form C E '
>         if invoice.vat13_5:                
>             cr.execute('select base_amount from account_invoice_tax
> where invoice_id = %s and name in
> (%s,%s)',(invoice.id,name13_5,name13))
>             base1 = cr.fetchall()[0]
>             #raise osv.except_osv(_('Message'), _(base1))
>             res[invoice.id]['sales_vat13_5'] =
> base1
>         if invoice.vat5:        
>             cr.execute('select base_amount from account_invoice_tax
> where invoice_id = %s and name in
> (%s,%s)',(invoice.id,name5,name5E))
>             base2 = cr.fetchall()[0]
>             #raise osv.except_osv(_('Message'), _(base2))
>             res[invoice.id]['sales_vat5'] = base2
>         if invoice.others:
>             cr.execute('select base_amount from account_invoice_tax
> where invoice_id = %s and name in
> (%s,%s,%s,%s,%s,%s,%s,%s,%s)',(invoice.id,namecst2,namecst2E,namevat2,namevat2E,namecst5,namecst5E,namecst13_5,namecst13_5E,namecst))
>             taxes = cr.fetchall()               
>             for t in taxes:
>                 base3 += t[0]
>             #raise osv.except_osv(_('Message'), _(base3))
>             res[invoice.id]['sales_others'] =
> base3
>         cr.execute('update account_invoice set sales_vat13_5=%s,
> sales_vat5=%s, sales_others=%s where
> id=%s',(base1,base2,base3,invoice.id))
>     return True
0
Avatar
Discard
Andreas Brueckl

Can you post the whole traceback of the error?

evon_dun
Author

hey i got my error corrected i just changed it to return res and i am sorted. Thanks anyways.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
How to create an automatic tax ?
tax account.invoice
Avatar
0
Mar 15
3809
AttributeError: 'report.account_bi_tax_report.report_bi_account_tax' object has no attribute '_get_report_values'
error tax noattribute odooV13
Avatar
Avatar
1
Aug 22
5346
Why a new tax is not recognized at the POS level?
python error tax posticket
Avatar
Avatar
Avatar
Avatar
4
Jan 21
10922
Register payment always registering less amount than TOTAL AMOUNT DUE even when paid full. Shows credit amount
invoice tax account account.invoice
Avatar
0
May 19
4878
AttributeError account_analytic_id not found
error update analytic account.invoice
Avatar
0
Mar 15
5014
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

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.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now