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 to solve product.uom error

Suscribirse

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

Se marcó esta pregunta
errorcustom
2 Respuestas
12893 Vistas
Avatar
Aijay Ogbugha

Hey guys, I created a form to receive data for a store. But on clicking the "save" button, i get this error: except_osv: ('Integrity Error', 'The operation cannot be completed, probably due to the following:\n- deletion: you may be trying to delete a record while other records still reference it\n- creation/update: a mandatory field is not correctly set\n\n[object with reference: Product Unit of Measure - product.uom]')

I really don't know why this error since i didn't inherit any object except the "mail.thread" object. Please i need help concerning this. It has really taken my time and i have limited time to deliver. And I don't know where else to look to solve it.

Any help will be appreciated please.

class store_products(osv.osv):
    _name='store.products'
    _description='Store Products'
    _inherit=['mail.thread']
    _columns={
         'name': fields.char('Description', size=128, required=True, translate=True, select=True),
         'my_product_id': fields.many2one('product.product', 'Product', required=True, select=True),
         'product_qty': fields.integer('Quantity', required=True, track_visibility='onchange'),
         'store_product_id': fields.many2one('store.issuing.voucher', 'Products'),
         'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
         #'account_code': fields.char('Account Code', size=32, readonly=False, required=True, track_visibility='onchange'),
         'account_code': fields.many2one('account.account', 'Account Code', required=True, track_visibility='onchange',
                                          help="The partner account used for this invoice."),
           }
store_products()


class store_issuing_voucher(osv.osv):
    _name = "store.issuing.voucher"
    _inherit = [ 'mail.thread']
    _description = "The Store Issuing Voucher"

    _columns={
          'employee_id': fields.many2one('hr.employee', 'Requestor', required=False,track_visibility='onchange'),
          'department_id': fields.many2one('hr.department', 'Department', required=False, track_visibility='onchange'),
          'organizational_id': fields.many2one('store.voucher.organization', 'Organizational Code', required=False, track_visibility='onchange'),
          'fund_code': fields.char('Fund Code', size=32, readonly=False, required=False, track_visibility='onchange'),
          'program_code': fields.char('Program Code', size=32, readonly=False, required=False, track_visibility='onchange'),
          'location_code': fields.char('Location Code', size=32, readonly=False, track_visibility='onchange'),
          'manager_id': fields.many2one('hr.employee', 'Store Voucher Present Manager', required=False, track_visibility='onchange'),              
          'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
          'date': fields.datetime('Date', require=True, select=True),
          'mystore_product_ids': fields.one2many('store.products', 'store_product_id', 'Store Product Lines'),
          'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
          'note': fields.text('Notes'),
}
store_issuing_voucher()

XML :

<record id="store_issuing_voucher_form" model="ir.ui.view">
        <field name="name">store.issuing.voucher.form</field>
        <field name="model">store.issuing.voucher</field>
        <field name="arch" type="xml">
            <form string="Store Issuing Voucher" version="7.0">
                    <sheet string="Store Issuing Voucher">
                        <group string="Requestor Details" col="4">
                            <field name="employee_id" on_change="onchange_employee_id(employee_id,department_id)" />
                            <field name="department_id"/>
                            <field name="date" />
                            <field name="organizational_id"  />
                            <field name="fund_code"  />
                            <field name="program_code"  />
                            <field name="location_code"  />
                            <field name="manager_id" />                                 
                        </group>
                    <group string="Product Item Details">
                        <notebook>
                            <page string="Store Products Lines">
                                <field name= "mystore_product_ids" />
                                <field name="note" placeholder="Add any note..." class="oe_inline" />
                            </page>
                        </notebook> 
                    </group>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>
    <!-- End of Store Issuing Voucher Form View -->

     <!-- Store Issuing Voucher tree View -->

    <record id="store_issuing_voucher_tree" model="ir.ui.view">
        <field name="name">store.issuing.voucher.tree</field>
        <field name="model">store.issuing.voucher</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Vouchers" >
              <!--  <field name="my_product_id"/>  -->
                <field name="employee_id"/>
                <field name="department_id" />
                <field name="organizational_id"/>
                <field name="program_code"/>
                <field name="value"/>
                <field name="date"/>
            </tree>
        </field>
    </record>

 <record id="store_products_form" model="ir.ui.view">
        <field name="name">store.products.form</field>
        <field name="model">store.products</field>
        <field name="arch" type="xml">
            <form string="Store Product Lines" version="7.0">
                <sheet>
                    <group col="4">
                        <field name="account_code"/>
                      <field name="my_product_id" on_change="onchange_my_product_id(my_product_id)"/>  
                      <!-- <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, False)"/>
                        <field name="name"/>-->
                        <field name="product_qty"/>
                        <field name="value"/>
                    </group>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>

 <record id="store_products_tree" model="ir.ui.view">
        <field name="name">store.products.tree</field>
        <field name="model">store.products</field>
        <field name="arch" type="xml">
            <tree string="Store Products">
                <field name="account_code"/>
                <field name="my_product_id"/>
                <field name="product_qty"/> 
                <field name="value"/>
            </tree>
        </field>
   </record>
0
Avatar
Descartar
Ghanshyam Prajapati

paste your code over here.

patrick

Canyou post your XML as well in the original question?

Aijay Ogbugha
Autor

I have posted both py and xml files. thanks

Avatar
patrick
Mejor respuesta

The error-message indicates that during deletion or creating/saving an error occured regarding consistency.

You say you want to save, so that means that your object somehow needs to know the uom (Unit Of Manufacturing). It might help, if you post your code in your question, so we can have a look how/what.

0
Avatar
Descartar
Avatar
Aijay Ogbugha
Autor Mejor respuesta
class store_products(osv.osv):
    _name='store.products'
    _description='Store Products'
    _inherit=['mail.thread']
    _columns={
         'name': fields.char('Description', size=128, required=True, translate=True, select=True),
         'my_product_id': fields.many2one('product.product', 'Product', required=True, select=True),
         'product_qty': fields.integer('Quantity', required=True, track_visibility='onchange'),
         'store_product_id': fields.many2one('store.issuing.voucher', 'Products'),
         'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
         #'account_code': fields.char('Account Code', size=32, readonly=False, required=True, track_visibility='onchange'),
         'account_code': fields.many2one('account.account', 'Account Code', required=True, track_visibility='onchange',
                                          help="The partner account used for this invoice."),
           }
store_products()


class store_issuing_voucher(osv.osv):
    _name = "store.issuing.voucher"
    _inherit = [ 'mail.thread']
    _description = "The Store Issuing Voucher"

    _columns={
          'employee_id': fields.many2one('hr.employee', 'Requestor', required=False,track_visibility='onchange'),
          'department_id': fields.many2one('hr.department', 'Department', required=False, track_visibility='onchange'),
          'organizational_id': fields.many2one('store.voucher.organization', 'Organizational Code', required=False, track_visibility='onchange'),
          'fund_code': fields.char('Fund Code', size=32, readonly=False, required=False, track_visibility='onchange'),
          'program_code': fields.char('Program Code', size=32, readonly=False, required=False, track_visibility='onchange'),
          'location_code': fields.char('Location Code', size=32, readonly=False, track_visibility='onchange'),
          'manager_id': fields.many2one('hr.employee', 'Store Voucher Present Manager', required=False, track_visibility='onchange'),              
          'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
          'date': fields.datetime('Date', require=True, select=True),
          'mystore_product_ids': fields.one2many('store.products', 'store_product_id', 'Store Product Lines'),
          'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
          'note': fields.text('Notes'),
}
store_issuing_voucher()
0
Avatar
Descartar
Aijay Ogbugha
Autor

This is the py file

¿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
"Undefined get method" error after installing unrelated model
error custom sale.order
Avatar
2
may 16
4886
Can´t install custom modules odoo 8.0
error module custom
Avatar
Avatar
2
mar 15
7370
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
oct 25
460
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
sept 25
1095
Error after installing "purchase" app in Odoo version 18
error
Avatar
Avatar
1
dic 24
6512
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