Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5291 Представления

i create a new object account.move.oi with inheritance from account.move :

_name = 'account.move.oi'
_inherit = '
account.move'

seq = fields.Char(string="OI No", default='New)

and in create function:

when i try to add new line_ids i get the error:

 ValueError: Invalid field 'seq' on model 'account.move'
any help please 

create function :

@api.model
def create(self, vals):
if vals.get('seq', 'New') == 'New':
vals['seq'] = self.env['ir.sequence'].next_by_code('ordre.imputation') + '20' or 'New'
result = super(AccountOI, self).create(vals)
return result

Аватар
Отменить
Лучший ответ

Hi


Seems like you are using "sequence" record for "account.move". Kindly create the sequence record for your model "account.move.oi"

        <record id="account_move_oi_internal" model="ir.sequence">
            <field name="name">Account Move IO</field>
            <field name="code">account.move.oi</field>
            <field name="prefix">INT/</field>
            <field name="padding">5</field>
            <field name="company_id" eval="False"/>
        </record>

Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited



Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
июн. 23
4273
1
мар. 21
5772
3
мая 20
4377
1
мая 25
9032
1
окт. 21
4289