main #4
@@ -93,6 +93,7 @@ class Model(
|
|||||||
cursor.execute(*ir_model.select(ir_model.id,
|
cursor.execute(*ir_model.select(ir_model.id,
|
||||||
where=ir_model.model == model.__name__))
|
where=ir_model.model == model.__name__))
|
||||||
model_id = None
|
model_id = None
|
||||||
|
logger.info("MODEL_NAME:%s",model.__name__)
|
||||||
if cursor.rowcount == -1 or cursor.rowcount is None:
|
if cursor.rowcount == -1 or cursor.rowcount is None:
|
||||||
data = cursor.fetchone()
|
data = cursor.fetchone()
|
||||||
if data:
|
if data:
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class Binary(Field):
|
|||||||
on_change_with=None, depends=None, context=None, loading='lazy',
|
on_change_with=None, depends=None, context=None, loading='lazy',
|
||||||
filename=None, file_id=None, store_prefix=None):
|
filename=None, file_id=None, store_prefix=None):
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.file_id = file_id
|
self.file_id = None #file_id
|
||||||
self.store_prefix = store_prefix
|
self.store_prefix = None #store_prefix
|
||||||
super(Binary, self).__init__(string=string, help=help,
|
super(Binary, self).__init__(string=string, help=help,
|
||||||
required=required, readonly=readonly, domain=domain, states=states,
|
required=required, readonly=readonly, domain=domain, states=states,
|
||||||
on_change=on_change, on_change_with=on_change_with,
|
on_change=on_change, on_change_with=on_change_with,
|
||||||
|
|||||||
@@ -103,15 +103,26 @@ class Model(URLMixin, PoolBase, metaclass=ModelMeta):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_name(cls):
|
def _get_name(cls):
|
||||||
'''
|
if cls.__doc__ is None:
|
||||||
Returns the first non-empty line of the model docstring.
|
print("\n💥 MODELE SANS DOCSTRING :", cls.__name__, " (module:", cls.__module__, ")")
|
||||||
'''
|
raise Exception("MODELE SANS DOCSTRING")
|
||||||
assert cls.__doc__, '%s has no docstring' % cls
|
|
||||||
lines = cls.__doc__.splitlines()
|
lines = cls.__doc__.splitlines()
|
||||||
for line in lines:
|
if lines:
|
||||||
line = line.strip()
|
return lines[0]
|
||||||
if line:
|
return cls.__name__
|
||||||
return line
|
|
||||||
|
# @classmethod
|
||||||
|
# def _get_name(cls):
|
||||||
|
# '''
|
||||||
|
# Returns the first non-empty line of the model docstring.
|
||||||
|
# '''
|
||||||
|
# assert cls.__doc__, '%s has no docstring' % cls
|
||||||
|
# lines = cls.__doc__.splitlines()
|
||||||
|
# for line in lines:
|
||||||
|
# line = line.strip()
|
||||||
|
# if line:
|
||||||
|
# return line
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __register__(cls, module_name):
|
def __register__(cls, module_name):
|
||||||
|
|||||||
15
modules/document_incoming_wr/__init__.py
Normal file
15
modules/document_incoming_wr/__init__.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
|
# this repository contains the full copyright notices and license terms.
|
||||||
|
|
||||||
|
from trytond.pool import Pool
|
||||||
|
|
||||||
|
from . import document
|
||||||
|
|
||||||
|
__all__ = ['register']
|
||||||
|
|
||||||
|
|
||||||
|
def register():
|
||||||
|
Pool.register(
|
||||||
|
document.IncomingConfiguration,
|
||||||
|
document.Incoming,
|
||||||
|
module='document_incoming_wr', type_='model')
|
||||||
50
modules/document_incoming_wr/document.py
Normal file
50
modules/document_incoming_wr/document.py
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
|
# this repository contains the full copyright notices and license terms.
|
||||||
|
|
||||||
|
from trytond.i18n import gettext
|
||||||
|
from trytond.model import fields
|
||||||
|
from trytond.modules.document_incoming.exceptions import (
|
||||||
|
DocumentIncomingProcessError)
|
||||||
|
from trytond.pool import Pool, PoolMeta
|
||||||
|
|
||||||
|
|
||||||
|
class IncomingConfiguration(metaclass=PoolMeta):
|
||||||
|
__name__ = 'document.incoming.configuration'
|
||||||
|
|
||||||
|
default_controller = fields.Many2One('party.party', "Default Controller")
|
||||||
|
|
||||||
|
|
||||||
|
class Incoming(metaclass=PoolMeta):
|
||||||
|
__name__ = 'document.incoming'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def __setup__(cls):
|
||||||
|
super().__setup__()
|
||||||
|
cls.type.selection.append(
|
||||||
|
('weight_report', "Weight Report"))
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _get_results(cls):
|
||||||
|
return super()._get_results() | {'automation.document'}
|
||||||
|
|
||||||
|
def _process_weight_report(self):
|
||||||
|
pool = Pool()
|
||||||
|
WR = pool.get('automation.document')
|
||||||
|
# Configuration = pool.get('document.incoming.configuration')
|
||||||
|
# config = Configuration(1)
|
||||||
|
wr = WR()
|
||||||
|
wr.document = self.id
|
||||||
|
wr.type = 'weight_report'
|
||||||
|
wr.state = 'draft'
|
||||||
|
WR.save([wr])
|
||||||
|
WR.run_ocr([wr])
|
||||||
|
WR.run_metadata([wr])
|
||||||
|
return wr
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def supplier_invoice_company(self):
|
||||||
|
# pass
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def supplier_invoice_party(self):
|
||||||
|
# pass
|
||||||
12
modules/document_incoming_wr/document.xml
Normal file
12
modules/document_incoming_wr/document.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?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. -->
|
||||||
|
<tryton>
|
||||||
|
<data>
|
||||||
|
<record model="ir.ui.view" id="ddocument_incoming_configuration_view_form">
|
||||||
|
<field name="model">document.incoming.configuration</field>
|
||||||
|
<field name="inherit" ref="document_incoming.document_incoming_configuration_view_form"/>
|
||||||
|
<field name="name">document_incoming_configuration_form</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</tryton>
|
||||||
8
modules/document_incoming_wr/tryton.cfg
Normal file
8
modules/document_incoming_wr/tryton.cfg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[tryton]
|
||||||
|
version=7.2.0
|
||||||
|
depends:
|
||||||
|
document_incoming
|
||||||
|
ir
|
||||||
|
party
|
||||||
|
xml:
|
||||||
|
document.xml
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?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="/form" position="inside">
|
||||||
|
<separator string="Weight Report" id="weight_report" colspan="4"/>
|
||||||
|
<label name="default_controller"/>
|
||||||
|
<field name="default_controller"/>
|
||||||
|
</xpath>
|
||||||
|
</data>
|
||||||
@@ -633,6 +633,7 @@ class SplitLine(ModelView):
|
|||||||
weight = fields.Numeric('Weight', digits=(16,5))
|
weight = fields.Numeric('Weight', digits=(16,5))
|
||||||
|
|
||||||
class SplitWizardStart(ModelView):
|
class SplitWizardStart(ModelView):
|
||||||
|
"Split Line Start"
|
||||||
__name__ = 'lot.split.wizard.start'
|
__name__ = 'lot.split.wizard.start'
|
||||||
|
|
||||||
mode = fields.Selection([
|
mode = fields.Selection([
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
name="Quality"
|
name="Quality"
|
||||||
sequence="110"
|
sequence="120"
|
||||||
id="menu_quality"
|
id="menu_quality"
|
||||||
icon="tryton-quality"/>
|
icon="tryton-quality"/>
|
||||||
<record model="ir.ui.menu-res.group" id="menu_quality_group_quality">
|
<record model="ir.ui.menu-res.group" id="menu_quality_group_quality">
|
||||||
|
|||||||
Reference in New Issue
Block a user