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

Doesn't execute the scheduled actions, help me?

Subscribe

Get notified when there's activity on this post

This question has been flagged
subscriptionir.cron
1 Reply
3840 Views
Avatar
Duvan Jose Guzman Cubillos

I need to run the following scheduled action:

​odoo
record id="ir_cron_renovation" model="ir.cron"
field name="name">Verificar vigencia de suscripciones /field
field name="model_id" ref="model_sale_subscription"/
field name="state" code /field
field name="code" model.check_espiry() /field
field name="interval_number" 1 /field
field name="interval_type" days /field
field name="numbercall" -1 /field
field name="doall" eval="True"/
field name="active" eval="True"/
record
odoo

This is my function:


class Renovation(models.Model):
​_inherit = 'sale.subscription'

​def check_espiry(self):

​#my code here

Manually if run but not automatically. The error is this :

"""

Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/tools/safe_eval.py", line 332, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
AttributeError: 'sale.subscription' object has no attribute 'activity_date_deadline_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/odoo/src/odoo/addons/mail/models/mail_render_mixin.py", line 456, in _render_template_inline_template
results[record.id] = render_inline_template(template_instructions, variables)
File "/home/odoo/src/odoo/odoo/tools/rendering_tools.py", line 71, in render_inline_template
result = safe_eval.safe_eval(expression, variables)
File "/home/odoo/src/odoo/odoo/tools/safe_eval.py", line 348, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
ValueError: : "'sale.subscription' object has no attribute 'activity_date_deadline_range'" while evaluating
' object.activity_date_deadline_range '

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_cron.py", line 367, in _callback
self.env['ir.actions.server'].browse(server_action_id).run()
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_actions.py", line 643, in run
res = runner(run_self, eval_context=eval_context)
File "/home/odoo/src/odoo/addons/website/models/ir_actions.py", line 61, in _run_action_code_multi
res = super(ServerAction, self)._run_action_code_multi(eval_context)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_actions.py", line 512, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
File "/home/odoo/src/odoo/odoo/tools/safe_eval.py", line 332, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
File "/home/odoo/src/user/renovation_subscription/models/renovation.py", line 75, in check_espiry
subscription.write({'stage_id': stage.id})
File "/home/odoo/src/odoo/addons/base_automation/models/base_automation.py", line 345, in write
write.origin(self.with_env(actions.env), vals, **kw)
File "/home/odoo/src/enterprise/sale_subscription/models/sale_subscription.py", line 374, in write
self._send_subscription_rating_mail(force_send=True)
File "/home/odoo/src/enterprise/sale_subscription/models/sale_subscription.py", line 547, in _send_subscription_rating_mail
subscription.rating_send_request(
File "/home/odoo/src/odoo/addons/rating/models/rating_mixin.py", line 166, in rating_send_request
record.message_post_with_template(
File "/home/odoo/src/odoo/addons/mass_mailing/models/mail_thread.py", line 37, in message_post_with_template
return super(MailThread, no_massmail).message_post_with_template(template_id, **kwargs)
File "/home/odoo/src/odoo/addons/mail/models/mail_thread.py", line 1979, in message_post_with_template
update_values = composer._onchange_template_id(template_id, kwargs['composition_mode'], self._name, res_id)['value']
File "/home/odoo/src/odoo/addons/mail/wizard/mail_compose_message.py", line 573, in _onchange_template_id
values = self.generate_email_for_composer(
File "/home/odoo/src/odoo/addons/mail/wizard/mail_compose_message.py", line 684, in generate_email_for_composer
template_values = self.env['mail.template'].with_context(tpl_partners_only=True).browse(template_id).generate_email(res_ids, fields)
File "/home/odoo/src/odoo/addons/account_edi/models/mail_template.py", line 21, in generate_email
res = super().generate_email(res_ids, fields)
File "/home/odoo/src/odoo/addons/mail/models/mail_template.py", line 203, in generate_email
generated_field_values = template._render_field(
File "/home/odoo/src/odoo/addons/mail/models/mail_render_mixin.py", line 607, in _render_field
return dict(
File "/home/odoo/src/odoo/addons/mail/models/mail_render_mixin.py", line 610, in
for res_id, rendered in template._render_template(
File "/home/odoo/src/odoo/addons/mail/models/mail_render_mixin.py", line 512, in _render_template
rendered = self._render_template_inline_template(template_src, model, res_ids,
File "/home/odoo/src/odoo/addons/mail/models/mail_render_mixin.py", line 459, in _render_template_inline_template
raise UserError(_("Failed to render inline_template template : %s)", e))
odoo.exceptions.UserError: No se pudo visualizar en la plantilla inline_template : : "'sale.subscription' object has no attribute 'activity_date_deadline_range'" while evaluating
' object.activity_date_deadline_range ')

""" 


0
Avatar
Discard
Avatar
shubham shiroya
Best Answer

here you need to define the object 'activity_date_deadline_range' in the 'sale.subscription' model because the activity_date_deadline_range object is not present in the 'sale.subscription' model

0
Avatar
Discard
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 do I transfer my subscription from the old database to the new one? Solved
subscription
Avatar
Avatar
1
Jun 25
2005
Subscription scam Solved
subscription
Avatar
Avatar
1
Apr 25
3615
This combination does not exist.
subscription
Avatar
Avatar
Avatar
2
Feb 25
6041
Does Odoo Support Usage Based Subscriptions?
subscription
Avatar
Avatar
Avatar
2
Nov 24
5300
Recurring billing from the previous month
subscription
Avatar
Avatar
1
Dec 25
2862
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