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

Hello

I'm building a module for displaying company information from a website. The module will display the company information in a tree view. But recently I have encountered a problem when clicking on a select button for a record the odoo gives me the error "Please click on the "save" button first". The records that I'm trying to put in are onchange and there is no need for saving. The goal is for the first button to activate the action "action_select_preview_line". I already tried removing the other 2 buttons and it still doesn't work.


XML:
"group
field name ="search_input"/
field name="preview_line_ids"
tree editable="top" create="False" delete="False"
field name="company_name"/
button
name="action_select_preview_line"
icon="fa-arrow-right"
type="object"
class="btn btn-secondary"
title="Select"/
/tree
/field
/group "

Python:

class PartnerWizardline(models.TransientModel):
_name = 'partner.wizard.line'
_description = 'Partner Autocomplete Wizard Line'

partner_wizard_id = fields.Many2one(
string='Partner wizard',
readonly=True
)

company_name = fields.Char(
string='Company name',
readonly=True
)

street = fields.Char(
string='Street',
readonly=True
)

city = fields.Char(
string='City',
readonly=True
)

zip = fields.Char(
string='ZIP',
readonly=True
)

vat = fields.Char(
string='VAT',
readonly=True
)

registration_number = fields.Char(
string='Registration number',
readonly=True
)

banks = fields.Char(
string='Banks',
readonly=True
)

def action_select_preview_line(self):
_logger.info(f"--------------------------")

class PartnerWizard(models.TransientModel):
_name = 'partner.wizard'
_description = 'Partner Autocomplete Wizard'

search_input = fields.Char(
string='Search',
help='Enter title, VAT ID, registration number or bank number'
)

preview_line_ids = fields.One2many(
comodel_name='partner.wizard.line',
inverse_name='partner_wizard_id',
string='Preview lines',
readonly=True,
compute='_compute_preview_line_ids'
)

vat_id = fields.Char(
string='VAT ID'
)

registration_no1= fields.Char(
string=('Registrska številka: ')
)

update_check = fields.Boolean(
string='Update Check',
default=False
)

company_name = fields.Char(
string='Company Name'
)

아바타
취소
관련 게시물 답글 화면 활동
0
5월 20
2969
3
12월 19
5270
6
12월 23
19910
1
3월 15
4464
1
7월 18
8154