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

XML-RPC Question: Why do account.analytic.line not become invoiceable when importing through xmlrpc?

Subscribe

Get notified when there's activity on this post

This question has been flagged
accountingxmlrpctimesheets
4996 Views
Avatar
Michael Hucke

Just have written an importer for OpenProject Ticket System to Odoo 10.0.

Everything works just perfect and automatic. Except one issue, where we just found a workaround, but no real solution yet.

Therefor i'll describe what we do and the workaround:

Maybe i am just missing something obvious someone may give the hint for me.

Excerpt of what the code does:

 # create sale.order for each imported project    .....
            odoo_id = ProjectProject.create(project_project)    .....
        saleorder = {                    'state': 'draft',                    'date_order': mk_date(row['created_on']),                    'user_id': 1,                    'currency_id': 1,                    'client_order_ref': 'Ticketsystem',                    'partner_id': partner_id[0],                    'partner_invoice_id': partner_id[0],                    'partner_shipping_id': partner_id[0],                    'project_id': pid[0]['analytic_account_id'][0], # Kostenstelle                    'project_project_id': odoo_id, # Projekt                    'picking_policy': 'direct',                    'pricelist_id': 1,                    'note': 'created from openproject import',                    'origin': project_project['openproject_id'],                    'warehouse_id': 1,                    'order_line': [                        (0, 0, {                            'product_uom_qty': 1,                            'product_uom': 5,                            'product_id': general_service_product, # this is product.product of type service, order_policy "timesheet"                        }),                    ],                }        SaleOrder = odoo.get_model('sale.order')        so_id = SaleOrder.search([('origin', '=', project_project['openproject_id'])])        if len(so_id) == 0:
            SaleOrder.create(saleorder)    .....
        # create account.analytic.line    .....
        accaline = {            'openproject_id': row['id'], # used to be able to update/add timesheet entries from openproject            'account_id': none2false(lookup_project_aa(lookup_project(row['project_id']))), # Analysekonto / many2one            'amount': row['hours'] * o.gethourprice(row['id']), # Betrag / monetary            'company_id': 1, # Unternehmen / many2one            'date': mk_date(row['spent_on']), # Datum / date            'name': cleantext(row['comments']), # Beschreibung / char            'product_id': general_service_product, # Produkt / many2one            'project_id': lookup_project(row['project_id']), # Projekt / many2one            'task_id': lookup_task('work_package_id'), # Aufgabe / many2one            'unit_amount': row['hours'], # Anzahl / float            'user_id': lookup_user(row['user_id']), # Benutzer / many2one            }        AccountAnalyticLine = odoo.get_model('account.analytic.line') # this is my xml-rpc factory        odoo_id = AccountAnalyticLine.search([('openproject_id', '=', accaline['openproject_id'])])        if not odoo_id:
            odoo_id = AccountAnalyticLine.create(accaline)    .....


After doing such import, Account analytic lines are all there.

But in Sales/Sales to invoice there is nothing to be invoiced.

Expected Result:

 

- all imported analytic entries should be on "sales to invoice"

Observed Result:

 

No imported entries appear to be invoiced

Workaround:

1. go into Accounting/Advisor/Analytic entries and select & export all, just one unimportant field like "ref".

2. re-import file from 1.

After this, all analytic entries are found to be billable under "Sales to invoice". Although there is no observable result in analytic entries.

Question:

What can be done programmatically to make those analytic entries invoiceable directly with import, without described workaround?

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
Auto Fiscal Localization for New Companies in Odoo 17
accounting xmlrpc FiscalPosition
Avatar
0
Jan 25
1451
Custom Field Calculation
accounting employee timesheets
Avatar
Avatar
1
Jun 24
2460
record timesheets for active projects on the balance sheet Solved
accounting accounts timesheets
Avatar
Avatar
1
May 23
4762
API - XMLRPC - Retrieve Accounting invoices from multiple companies at once
accounting xmlrpc multicompany
Avatar
Avatar
1
Mar 21
3382
Invoice-Digitize-Individual Line Items
accounting
Avatar
Avatar
1
Nov 25
411
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