Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

How i can add a new state to PO?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
inheritanceinheritstate
2 Respuestas
6918 Vistas
Avatar
mirko lazzarini

This is my script but it don't function (AttributeError: 'purchase.order' object has no attribute 'req_aut')

import time import datetime

from openerp.osv import fields, osv from openerp.tools.translate import _

class Purchase(osv.osv): '''Purchase'''

_name = "purchase.order"
_inherit = 'purchase.order'

#def create(self, cr, uid, ids, context=None):
    #TODO:Definire i gruppi e mandare mail
 #   mail_message = self.pool.get('mail.message')
  #  mail_message.schedule_with_attach(cr, uid, 'api@ipi.it','ati@gmail.com',"aaaaaa","asdd",subtype='html',)i
    #notification_obj.create(cr, uid, {'user_id': uid, 'message_id': msg_id}, context=context)
    #return True

def set_req_aut(self, cr, uid, ids, context=None):    
    self.write(cr, uid, ids, { 'state' : 'req_aut' }, context=context)
    return True

def set_aut_conf(self, cr, uid, ids, context=None):
     self.write(cr, uid, ids, { 'state' : 'aut_conf' })
    return True

STATE_SELECTION = [ ('draft', 'Draft PO'), ('sent', 'RFQ Sent'), ('confirmed', 'Waiting Approval'), ('req_aut', 'Request Authorization'), ('aut_conf', 'Authorization Confirmed'), ('approved', 'Purchase Order'), ('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled') ]

_columns = {
    'project_ids': fields.many2one('project.project', string='Project refs'),

    'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The status of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' status. Then the order has to be confirmed by the user, the status switch to 'Confirmed'. Then the supplier must confirm the order to change the status to 'Approved'. When the purchase order is paid and received, the status becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the status becomes in exception.", select=True),

}

Purchase()

<openerp> <data>

<record model="ir.ui.view" id="edit_order_form">
    <field name="name">purchase.order.form</field>
    <field name="model">purchase.order</field>
        <field name="type">form</field>
            <field name="inherit_id" ref="purchase.purchase_order_form"/>
            <field name="arch" type="xml">
        <xpath expr="/form/header/button[@name='purchase_confirm']" position="before">
                <button name="req_aut" states="sent" string="Request Authorization" type="object"/>
                     <button name="aut_conf" states="req_aut" string="Authorization Confirmed" type="object"/>
              </xpath>
        <xpath expr="/form/header/field[@name='state']" position="replace">
                       <field name="state" widget="statusbar" statusbar_visible="draft, sent, req_aut, aut_conf, approved, done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue"}' readonly="1"/>
              </xpath>
        <xpath expr="/form/sheet/group/group/field[@name='partner_ref']" position="after">
                 <field name="project_ids" />
            </xpath>
            </field>
   </record>
</data>

</openerp>

0
Avatar
Descartar
Avatar
joseph d'souza
Mejor respuesta

Remove this things in your inherited class

 _name = "purchase.order"

Add purchase in custom module __openerp__.py file

'depends': ['purchase'],

Restart your OpenERP serevr and update or install your custom module in your database.

Hope it works !!

Thanks,

dsouzajoseph199@gmail.com

0
Avatar
Descartar
Avatar
AJ Schrafel Paper Corp
Mejor respuesta

did you stop/ start your server?

did you make your module depend on purchase?

try these two things and see if that fixes it.

0
Avatar
Descartar
mirko lazzarini
Autor

yes it depend on purchase... but don't function

AJ Schrafel Paper Corp

did you completely stop/ start your server? Stop the server then type ps aux | grep openerp or look at your process list in windows to make sure you have stopped all instances of the server.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
How to extend an existing class and include social newtork features in the sub class
inheritance inherit
Avatar
Avatar
3
jul 18
4637
Inheritance in discuss module (mail)
inheritance inherit discuss
Avatar
0
ene 22
3382
How to create tree view of sibling models ? Resuelto
treeview inheritance inherit
Avatar
1
jul 15
4513
Change sale module view, treestrings, names, button names
inheritance inherit sale.order
Avatar
0
mar 15
5816
Calling two models in one model Resuelto
inheritance models multiple inherit
Avatar
Avatar
3
dic 22
5232
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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