Skip to Content
Odoo Menu
  • Prijavi
  • 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
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

The automated action doesn`t work

Naroči se

Get notified when there's activity on this post

This question has been flagged
cronautomatedodoo8.0
2 Odgovori
4703 Prikazi
Avatar
Konstantin

I have py script

# -*- coding: utf-8 -*-
from openerp import models, fields, api
from datetime import datetime, date
from openerp.tools.translate import _
class AddPriority(models.Model):
_name = 'account.invoice.priority'
_description = "Descriptions for new priority"
name = fields.Char('Name', size = 26, required=True, help='Name for new priority')
descript = fields.Text( 'Description', help='Descriptions for new priority')
class My_invoices(models.Model):
_inherit = 'account.invoice'
priority = fields.Many2one('account.invoice.priority', string='Priority', required=True, help='Select Priority', store=True)
delay = fields.Integer(string = 'Delay', readonly = True, help = 'Day Delay', compute='_delay', store=True )
@api.multi
@api.depends('date_due','delay')
def _delay(self):
if self.date_due != False:
day_delay = datetime.strptime(self.date_due, '%Y-%m-%d').date()
day_now = date.today()
day = str(day_delay - day_now)
day = day.replace('0:00:00','')
if 'day' in day:
day = day.replace(' day, ','')
if 'days'in day:
day = day.replace(' days, ','')
if day =='':
day = 0
else:
day = int(day)
self.delay = day
def my_up(self, cr, uid, context= None):
scheduler_line_obj = self.pool.get('account.invoice')
scheduler_line_ids = self.pool.get('account.invoice').search(cr, uid, [])
for scheduler_line_id in scheduler_line_ids :
scheduler_line =scheduler_line_obj.browse(cr, uid,scheduler_line_id ,context=context)
delay = scheduler_line.delay
scheduler_line_obj.write(cr, uid, scheduler_line_id, {'delay': (delay -1)}, context=context)
and xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
 <record id="update_date_action" model="ir.cron">
<field name="name">Date for invoice priority</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field eval="'My_invoices'" name="model"/>
<field eval="'my_up'" name="function"/>
</record>
 </data>
</openerp>


Cron was created but dont work. Why does nothing happen? where is my mistake? 

0
Avatar
Opusti
Avatar
Jérémy Kersten (jke)
Best Answer

Maybe if you provide your traceback, it will help us to help you :)

But in any case 'My_invoices' is not a model... it should probably be something like 'account.invoice' so <field name='model' ref='model_account_invoice'/> or <field name='model'>account.invoice</field>

0
Avatar
Opusti
Avatar
Konstantin
Avtor Best Answer

Thanks Jérémy Kersten really inheritance model is necessary to specify the parent. Sorry for my English

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to make cron for running schedulers? Solved
cron scheduler automation odoo8.0
Avatar
Avatar
Avatar
2
mar. 15
10966
Trying to automatically update analytic distribution in purchase order Solved
automated
Avatar
Avatar
Avatar
3
jun. 25
3455
automation rules not saved
automated
Avatar
0
maj 24
2280
how to implement joint piece in odoo 8 in one view
odoo8.0
Avatar
0
apr. 24
2570
Automated actions
automated
Avatar
Avatar
1
mar. 24
2137
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