Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

OdooV13 unindent does not match any outer indentation level

Odebírat

Get notified when there's activity on this post

This question has been flagged
3 Odpovědi
4376 Zobrazení
Avatar
Madara

iam getting this error in my custom module , coz of this iam unable to start my server

   __import__('odoo.addons.' + module_name)
  File "/odoo/odoo-server/addons/transfers/__init__.py", line 4, in <module>
    from . import transfers
File "/odoo/odoo-server/addons/transfers/transfers.py", line 22
    @api.model
             ^
IndentationError: unindent does not match any outer indentation level - - -



transfers.py:



# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import models, fields, api , _



class Transfers(models.Model):
     _name ="transfers.name"
     _inherit = ['mail.thread','mail.activity.mixin']
     _description ="Transfer Record"

     transfers_Name = fields.Char(string="Name", required = True)
     transfers_ISO = fields.Char(string="ISO")
     transfers_amount = fields.Integer("Amount")
     notes = fields.Text(string ="Notes")
     image = fields.Binary(string ="Image")
     name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, states={'draft': [('readonly', False)]}, index=True, default=lambda self: _('New'))



    @api.model
    def create(self, vals):
        if vals.get('name', _('New')) == _('New'):

             vals['name'] = self.env['ir.sequence'].next_by_code('transfer.order.sequence', sequence_date=seq_date) or _('New')

        result = super(Transfers, self).create(vals)
        return result


sequence.xml:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">

        <!-- Sequences for sale.order -->
        <record id="seq_transfers" model="ir.sequence">
            <field name="name">Transfer Order</field>
            <field name="code">transfer.order.sequence</field>
            <field name="prefix">T0</field>
            <field name="padding">5</field>
            <field name="company_id" eval="False"/>
        </record>

    </data>
</odoo>



manifest.py:

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

{
    'name': 'Transfers',
    'version': '1.0',
    'summary': 'Module for Money Transfer',
    'category': 'Extra Tools',
    'description':
    """
Transifex integration
=====================
This module will add a link to the Transifex project in the translation view.
The purpose of this module is to speed up translations of the main modules.

To work, Odoo uses Transifex configuration files `.tx/config` to detec the
project source. Custom modules will not be translated (as not published on
the main Transifex project).

The language the user tries to translate must be activated on the Transifex
project.
        """,
    'data': [
        'security/ir.model.access.csv' ,
        'data/sequence.xml' ,
        'transfers.xml',
       
    ],
    'depends': ['mail'],
    'installable':True,
    'application':True,
    'auto_install':False,
}



someone help iam a newbie to odoo13 development


0
Avatar
Zrušit
Sehrish

You have to read this: https://old.reddit.com/r/PythonForOdoo/

Avatar
Ashish Singh
Nejlepší odpověď

Hi, Guna


Kindly update the below code, Actually all fields which you defined inside the models contains extra space due to this you are getting the "Indentation" issue.
class Transfers(models.Model):
 
_name ="transfers.name"
  _inherit = ['mail.thread','mail.activity.mixin']
  _description ="Transfer Record"

  transfers_Name = fields.Char(string="Name", required = True)
  transfers_ISO = fields.Char(string="ISO")
  transfers_amount = fields.Integer("Amount")
  notes = fields.Text(string ="Notes")
  image = fields.Binary(string ="Image")
  name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, states={'draft': [('readonly', False)]}, index=True, default=lambda self: _('New'))

@api.model
def create(self, vals):
if vals.get('name', _('New')) == _('New'):
  vals['name'] = self.env['ir.sequence'].next_by_code('transfer.order.sequence', sequence_date=seq_date) or _('New')
  result = super(Transfers, self).create(vals)
return result

Feel free to ask in case you have any confusion related to the above points.
You may get undefined "seq_date" key error. So please don't forget to define this field inside the create method.

Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited

4
Avatar
Zrušit
Avatar
Urvisha
Nejlepší odpověď

Hi
you did mistake on indentation. In most other programming languages, indentation is used only to help make the code look pretty. But in Python, it is required for indicating what block of code a statement belongs to.

please write code like this in .py file 

class Transfers(models.Model): _name ="transfers.name" _inherit = ['mail.thread','mail.activity.mixin'] _description ="Transfer Record" transfers_Name = fields.Char(string="Name", required = True) transfers_ISO = fields.Char(string="ISO") transfers_amount = fields.Integer("Amount") notes = fields.Text(string ="Notes") image = fields.Binary(string ="Image") name = fields.Char(string='Order Reference', required=True, copy=False,readonly=True, states={'draft': [('readonly', False)]}, index=True, default=lambda self: _('New')) @api.model def create(self, vals): if vals.get('name', _('New')) == _('New'): vals['name'] = self.env['ir.sequence'].next_by_code('transfer.order.sequence', sequence_date=seq_date) or _('New') result = super(Transfers, self).create(vals) return result


0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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