Ir al contenido
Menú
Se marcó esta pregunta

 Hi,

I tried to push my custom module (adding a new state in sale order model) to my dev branch in Odoo.sh version 18, but I have the following WARNING message in install.log:
no translation language detected, skipping translation <frame at 0x7e15b127bf40, file '/home/odoo/src/user/custom_sale_state/models/sale_order.py', line 9, code SaleOrder>

I have a *.po translation file in my folder i18n.

Here is the content of my models/sale_order.py file:

from odoo import models, fields, _


class SaleOrder(models.Model):

_inherit = "sale.order"


state = fields.Selection(selection_add=[

('validated', _("Validated")),

('sale', _("Sales Order"))

])



def action_validated(self):

self.write({'state': 'validated'})



def _confirmation_error_message(self):

"""Allow confirming orders in 'validated' state."""

self.ensure_one()


error_msg_state = _("Some orders are not in a state requiring confirmation.")

error_msg_product = _("A line on these orders is missing a product, you cannot confirm it.")


if self.state not in {'draft', 'sent', 'validated'}:

return error_msg_state

if any(

not line.display_type

and not line.is_downpayment

and not line.product_id

for line in self.order_line

):

return error_msg_product


return False

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 15
3138
2
mar 15
4040
2
ene 24
1681
2
oct 15
6219
1
mar 15
5129