Add date + result_notes in document_incoming

This commit is contained in:
2026-04-21 18:40:51 +02:00
parent cfb719a7da
commit b1680cc96c
5 changed files with 29 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="create_date"/>
<field name="name" expand="2"/>
<field name="source" expand="1" optional="0"/>
<field name="company" expand="1" optional="1"/>

View File

@@ -18,6 +18,10 @@ class IncomingConfiguration(metaclass=PoolMeta):
class Incoming(metaclass=PoolMeta):
__name__ = 'document.incoming'
result_notes = fields.Function(
fields.Text("Result Notes"),
'get_result_notes')
@classmethod
def __setup__(cls):
super().__setup__()
@@ -39,7 +43,7 @@ class Incoming(metaclass=PoolMeta):
WR.save([wr])
WR.run_ocr([wr])
WR.run_metadata([wr])
WR.run_pipeline([wr])
return wr
def _process_controller(self):
@@ -54,6 +58,14 @@ class Incoming(metaclass=PoolMeta):
return wr
def get_result_notes(self, name=None):
result = getattr(self, 'result', None)
if not result:
return ''
if getattr(result, '__name__', None) == 'automation.document':
return getattr(result, 'notes', '') or ''
return ''
# @property
# def supplier_invoice_company(self):
# pass

View File

@@ -8,5 +8,10 @@ this repository contains the full copyright notices and license terms. -->
<field name="inherit" ref="document_incoming.document_incoming_configuration_view_form"/>
<field name="name">document_incoming_configuration_form</field>
</record>
<record model="ir.ui.view" id="document_incoming_view_list_wr">
<field name="model">document.incoming</field>
<field name="inherit" ref="document_incoming.document_incoming_view_list"/>
<field name="name">document_incoming_list_wr</field>
</record>
</data>
</tryton>

View File

@@ -2,7 +2,9 @@
version=7.2.0
depends:
document_incoming
automation
ir
party
xml:
document.xml
view/document_incoming_list.xml

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='result']" position="after">
<field name="result_notes" expand="2"/>
</xpath>
</data>