0
votes

I am working on point of sale where i need to display 'Payment Journal'(Cash / Cheque) and statement id (statement) from 'Accounting' module which containing these fields only not POS. S o need to display in tree view of Point of sale(orders) list. here is my code i tried :

journal_ids = fields.Many2one('account.journal', string='Journal', readonly=True, domain=[('type', 'in', ('bank', 'cash'))])
journal_id = fields.Char(related='journal_ids.type', store=True)
1
Check if journal_ids has value, plus make sure they are visible in viewDachi Darchiashvili
And a little hint: use the odoo coding guidelines. The first field should be named journal_id while the second should be called journal_name (or something in that way, nothing in the guideline).CZoellner
Still can't display value in tree view. Is there any way to access field of one model to another model's view ?majid
Could you post your xml code?.KbiR
<tree string="POS Orders" decoration-info="state == 'draft'" decoration-muted="state in ('done','cancel')" create="0"> <field name="name"/> <field name="partner_id"/> <field name="date_order"/> <field name="journal_id" />widget="monetary"/> <field name="company_id" groups="base.group_multi_company"/> <field name="state"/> <field name="session_id" /> </tree>majid

1 Answers

0
votes

This is working in base "Point of Sale".. You can take reference from "account_journal_view.xml" In this you get to know that they are just using tree view of account model in POS "Payment Method" menu. Just inherit this in your custom module add fields what you want to add using tag in tree view and you get result what you want.