콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

 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

아바타
취소
관련 게시물 답글 화면 활동
0
3월 15
3886
2
3월 15
4885
2
1월 24
2539
2
10월 15
6991
1
3월 15
5826