Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Yleismies
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivouspalvelut
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Kurssit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

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

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

wizard_payment_order('populate_payment_ext') TypeError: __new__() takes exactly 1 argument (2 given)

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
posaccount
1 Vastaa
6548 Näkymät
Avatar
sridhar

I Tried to Install account_payment_extension it is open source module developed for 6.x version. But now i try to install on OpenERP 7, but it making error, i got this error wizard_payment_order('populate_payment_ext') TypeError: __new__() takes exactly 1 argument (2 given), previously i faced the error that is ImportError: No module named wizard then i change hide the import wizard and class wizard_payment_order(osv.TransientModel): here is my code #import wizard import pooler from tools.misc import UpdateableStr import time from osv import fields, osv

FORM = UpdateableStr()

FIELDS = { 'entries': {'string':'Entries', 'type':'many2many', 'relation':'account.move.line',}, 'communication2': {'string':'Communication 2', 'type':'char', 'size': 64, 'help':'The successor message of payment communication.'}, }

field_duedate={ 'duedate': {'string':'Due Date', 'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d'),}, 'amount': {'string':'Amount', 'type':'float', 'help': 'Next step will automatically select payments up to this amount as long as account moves have bank account if that is required by the selected payment mode.'}, 'show_refunds': {'string':'Show Refunds','type':'boolean', 'help':'Indicates if search should include refunds.', 'default': lambda *a: False}, } arch_duedate=''' <form string="Search Payment lines" col="2"> <field name="duedate"/> <field name="amount"/> <field name="show_refunds"/> </form>'''

def search_entries(self, cr, uid, data, context): search_due_date = data['form']['duedate'] show_refunds = data['form']['show_refunds']

pool = pooler.get_pool(cr.dbname)
order_obj = pool.get('payment.order')
line_obj = pool.get('account.move.line')

payment = order_obj.browse(cr, uid, data['id'],
        context=context)
ctx = ''
if payment.mode:
    ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id

# Search for move line to pay:
domain = [('reconcile_id', '=', False),('account_id.type', '=', payment.type),('amount_to_pay', '<>', 0)]

if payment.type =='payable' and not show_refunds:
    domain += [ ('credit','>',0) ]
elif not show_refunds:
    domain += [ ('debit','>',0) ]

if payment.mode:
    domain += [('payment_type','=',payment.mode.type.id)]

domain += ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)]
line_ids = line_obj.search(cr, uid, domain, order='date_maturity', context=context)


FORM.string = '''<?xml version="1.0" encoding="utf-8"?>

<form string="Populate Payment:"> <field name="entries" colspan="4" height="300" width="800" nolabel="1" domain="[('id', 'in', [%s])]" %s=""/> <separator string="Extra message of payment communication" colspan="4"/> <field name="communication2" colspan="4"/> </form>''' % (','.join([str(x) for x in line_ids]), ctx)

selected_ids = []

amount = data['form']['amount']
if amount:
    if payment.mode and payment.mode.require_bank_account:
        line2bank = line_obj.line2bank(cr, uid, line_ids, payment.mode.id, context)
    else:
        line2bank = None
    # If user specified an amount, search what moves match the criteria taking into account
    # if payment mode allows bank account to be null.
    for line in line_obj.browse(cr, uid, line_ids, context):
        if abs(line.amount_to_pay) <= amount:
            amount -= abs(line.amount_to_pay)
            selected_ids.append( line.id )
else:
    selected_ids = line_ids

return {
    'entries': selected_ids,
}

def create_payment(self, cr, uid, data, context): line_ids= data['form']['entries'][0][2] if not line_ids: return {}

pool= pooler.get_pool(cr.dbname)
order_obj = pool.get('payment.order')
line_obj = pool.get('account.move.line')

payment = order_obj.browse(cr, uid, data['id'],
        context=context)
t = payment.mode and payment.mode.type.id or None
line2bank = pool.get('account.move.line').line2bank(cr, uid,
        line_ids, t, context)

## Finally populate the current payment with new lines:
for line in line_obj.browse(cr, uid, line_ids, context=context):
    if payment.date_prefered == "now":
        #no payment date => immediate payment
        date_to_pay = False
    elif payment.date_prefered == 'due':
        date_to_pay = line.date_maturity
    elif payment.date_prefered == 'fixed':
        date_to_pay = payment.date_scheduled

    if payment.type == 'payable':
        amount_to_pay = line.amount_to_pay
    else:
        amount_to_pay = -line.amount_to_pay
    pool.get('payment.line').create(cr,uid,{
        'move_line_id': line.id,
        'amount_currency': amount_to_pay,
        'bank_id': line2bank.get(line.id),
        'order_id': payment.id,
        'partner_id': line.partner_id and line.partner_id.id or False,
        'communication': (line.ref and line.name!='/' and line.ref+'. '+line.name) or line.ref or line.name or '/',
        'communication2': data['form']['communication2'],
        'date': date_to_pay,
        'currency': line.invoice and line.invoice.currency_id.id or False,
        'account_id': line.account_id.id,
        }, context=context)
return {}

class wizard_payment_order(osv.TransientModel): """ Create a payment object with lines corresponding to the account move line to pay according to the date provided by the user and the mode-type payment of the order. Hypothesis: - Small number of non-reconcilied move line , payment mode and bank account type, - Big number of partner and bank account.

If a type is given, unsuitable account move lines are ignored.
"""
states = {

    'init': {
        'actions': [],
        'result': {
            'type': 'form',
            'arch': arch_duedate,
            'fields':field_duedate,
            'state': [
                ('end','_Cancel'),
                ('search','_Search', '', True)
            ]
        },
     },

    'search': {
        'actions': [search_entries],
        'result': {
            'type': 'form',
            'arch': FORM,
            'fields': FIELDS,
            'state': [
                ('end','_Cancel'),
                ('create','_Add to payment order', '', True)
            ]
        },
     },
    'create': {
        'actions': [],
        'result': {
            'type': 'action',
            'action': create_payment,
            'state': 'end'}
        },
    }

wizard_payment_order('populate_payment_ext') Please help me i struggled here.

Thanks& Regards Sridharan G

0
Avatar
Hylkää
Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Paras vastaus

Just changing wizard.interface into osv.TransientModel won't work. You have to convert it just like all other wizards (memory wizards) available in v7.

My answer (Convert interface into memory wizard) could help you to convert it.

1
Avatar
Hylkää
sridhar
Tekijä

This Wizard dont having a .XML file then where i paste this code my_form = <?xml version="1.0"?> <form string="Category Summary"> <group colspan="4"> <button name="check" type="object"/> </group> </form>

Sudhir Arya (ERP Harbor Consulting Services)

You have to create xml file and have to copy past the view related code.

sridhar
Tekijä

i don't have interface.py file wat to do. i'm new for openerp, so tuff to understand please help me...

Sudhir Arya (ERP Harbor Consulting Services)

You have to convert your current py file.

sridhar
Tekijä

It is tuf to understand send me a sample module please...

Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
POS: Setting some payment methods to not mark invoice as paid
sales pos account
Avatar
0
jouluk. 15
3631
POS sales to analytic account
pos account analytic
Avatar
0
maalisk. 15
4726
Kitchen printing printer other than odoo provided list
pos
Avatar
Avatar
1
marrask. 25
205
POS Table Synchronization Issue Between Devices in Odoo v17 CE
pos
Avatar
Avatar
Avatar
2
marrask. 25
2623
Refund and Discount access to admin user only for Pos selling
pos
Avatar
Avatar
1
marrask. 25
448
Yhteisö
  • Kurssit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Tavaramerkki
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة 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 on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

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