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

Server Action not found: AttributeError: 'my.model' object has no attribute 'action_create_inventory_from_selection'

Subscribe

Get notified when there's activity on this post

This question has been flagged
actiondevelopmentsever_action
2 Replies
248 Views
Avatar
Parker D

Hello there :)

I am trying to add an action to a simple app I've made. 

Therefore I have added a method to my class:

class RollsManagement(models.Model):
_name = 'rollsmanagement.roll'
_description = 'Managing rolls'
_order = 'sequence'
_rec_name = 'name'
...

simply like this:

...
def action_create_inventory_from_selection(self):
​....

In my XML I've added the action like this:

    <record id="action_roll_inventory_import" model="ir.actions.server">
<field name="name">Create Inventory from Rolls</field>
<field name="model_id" ref="model_rollsmanagement_roll"/>
<field name="binding_model_id" ref="model_rollsmanagement_roll"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
action = model.action_create_inventory_from_selection()
</field>
</record>

My action appears when I've selected one or more data entries (rolls) in the drop down button "Actions" and when I click it, it ends in this error:

File "ir.actions.server(660,)", line 1, in <module>
AttributeError: 'rollsmanagement.roll' object has no attribute 'action_create_inventory_from_selection'

I have the strong feeling, I am missing something essential, maybe simple even. The model is there and working as always but somehow it seems that I cannot call the action the right way. Two LLMs are already at the end of their knowledge, it seems. Does anyone have a hint?

PS: If you're interested, my app lists some special rolls and simple information about them. I try to make an action that sums up their square meters and put that into the inventory adjustment. 

0
Avatar
Discard
Codesphere Tech

Hello,
Remove binding_model_id and write with decorator as below:
@api.model
def action_create_inventory_from_selection(self):

Let me know if it is not working.

Parker D
Author

Hi @Codesphere Tech :) Thanks, but still the same: "AttributeError: 'rollsmanagement.roll' object has no attribute 'action_create_inventory_from_selection'".

Avatar
Parker D
Author Best Answer

I am sorry everybody, I was tricked by the caching of my docker container and it's test environment. Thank you to you anyway and your recommendations were helpful! Maybe this will be as well for someone.

0
Avatar
Discard
Avatar
Kunjan Patel
Best Answer
Hello Parker D,
I hope you are doing well

The method exists but Odoo can't find it. This is a module loading issue, not XML.
Solution:
1. Restart Odoo server (required for Python changes)
2. Upgrade module: Apps → Your Module → Upgrade (or ./odoo-bin -u your_module -d your_db)
3. Verify method indentation is inside the class
4. Check models/__init__.py imports your file
5. Use records (not model) in the XML

I hope this information helps you.

Thanks & Regards,
Kunjan Patel
0
Avatar
Discard
Parker D
Author

Thank you Kunjan Patel, but both, records and record have the identical result: "AttributeError: 'rollsmanagement.roll' object has no attribute 'action_create_inventory_from_selection'".

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
¿Cómo llamar a BoA desde celular?
action development
Avatar
0
Nov 25
2
Convert Consumable Product to Storable Product تحويل حالة المنتجات الى قابل للتخزين Solved
action development configuration
Avatar
Avatar
1
Nov 25
206
How can I automatically send an email to customers when their order is confirmed in Odoo? I want to make sure they receive a confirmation without doing it manually every time. Solved
action development configuration
Avatar
1
Sep 25
5801
Button without odoo access via Email Template
action development mail
Avatar
Avatar
1
Sep 25
1016
Missing products in zpl report from wizard
action development wizard
Avatar
0
Jul 25
1051
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