mirror of
https://github.com/NaN-tic/trytond-systemlogics_modula.git
synced 2023-12-14 04:32:53 +01:00
Shipment Out Export Systemlogics Modula
This commit is contained in:
parent
338852ae9d
commit
ae512f33d9
|
@ -15,10 +15,12 @@ def register():
|
|||
Product,
|
||||
ShipmentIn,
|
||||
ShipmentOut,
|
||||
ShipmentOutSystemlogicsModulaExportStart,
|
||||
ShipmentInternal,
|
||||
SystemlogicsModulaArticoli,
|
||||
SystemlogicsModulaArticoliResult,
|
||||
module='systemlogics_modula', type_='model')
|
||||
Pool.register(
|
||||
ShipmentOutSystemlogicsModulaExport,
|
||||
SystemlogicsModulaArticoli,
|
||||
module='systemlogics_modula', type_='wizard')
|
||||
|
|
23
shipment.xml
23
shipment.xml
|
@ -9,5 +9,28 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
|
|||
<field name="inherit" ref="stock.shipment_in_view_form"/>
|
||||
<field name="name">shipment_in_form</field>
|
||||
</record>
|
||||
|
||||
<!-- stock.shipment.out export wizard -->
|
||||
<record model="ir.ui.view" id="shipment_out_export_form">
|
||||
<field name="model">stock.shipment.out.systemlogics.modula.export.start</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">shipment_out_export_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.wizard" id="wizard_shipment_out_export">
|
||||
<field name="name">Export Systemlogics Modula</field>
|
||||
<field name="wiz_name">stock.shipment.out.systemlogics.modula.export</field>
|
||||
<field name="model">stock.shipment.out</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="shipment_out_export_keyword">
|
||||
<field name="keyword">form_action</field>
|
||||
<field name="model">stock.shipment.out,-1</field>
|
||||
<field name="action" ref="wizard_shipment_out_export"/>
|
||||
</record>
|
||||
<record model="ir.action-res.group"
|
||||
id="action_group_wizard_shipment_out_export">
|
||||
<field name="action" ref="wizard_shipment_out_export"/>
|
||||
<field name="group" ref="group_systemlogics_modula"/>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
48
stock.py
48
stock.py
|
@ -5,8 +5,10 @@ from trytond.pool import Pool, PoolMeta
|
|||
from trytond.model import ModelView, fields
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pyson import Eval
|
||||
from trytond.wizard import Wizard, StateView, Button, StateTransition
|
||||
|
||||
__all__ = ['ShipmentIn', 'ShipmentOut', 'ShipmentInternal']
|
||||
__all__ = ['ShipmentIn', 'ShipmentOut', 'ShipmentInternal',
|
||||
'ShipmentOutSystemlogicsModulaExportStart', 'ShipmentOutSystemlogicsModulaExport']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
|
@ -198,3 +200,47 @@ class ShipmentInternal:
|
|||
def assign(cls, shipments):
|
||||
super(ShipmentInternal, cls).assign(shipments)
|
||||
cls.generate_systemlogics_modula(shipments)
|
||||
|
||||
|
||||
class ShipmentOutSystemlogicsModulaExportStart(ModelView):
|
||||
'Customer shipments export Systemlogics Modula Start'
|
||||
__name__ = 'stock.shipment.out.systemlogics.modula.export.start'
|
||||
shipments = fields.Many2Many('stock.shipment.out', None, None, 'Shipments',
|
||||
domain=[
|
||||
('state', 'in', ['assigned']),
|
||||
],
|
||||
states={
|
||||
'required': True,
|
||||
},
|
||||
help='Assigned customer shipments to export Systemlogics Modula.')
|
||||
|
||||
@staticmethod
|
||||
def default_shipments():
|
||||
ShipmentOut = Pool().get('stock.shipment.out')
|
||||
|
||||
active_ids = Transaction().context.get('active_ids', [])
|
||||
shipments = ShipmentOut.search([
|
||||
('id', 'in', active_ids),
|
||||
('state', 'in', ['assigned']),
|
||||
])
|
||||
return [s.id for s in shipments]
|
||||
|
||||
|
||||
class ShipmentOutSystemlogicsModulaExport(Wizard):
|
||||
'Customer shipments export Systemlogics Modula'
|
||||
__name__ = 'stock.shipment.out.systemlogics.modula.export'
|
||||
|
||||
start = StateView('stock.shipment.out.systemlogics.modula.export.start',
|
||||
'systemlogics_modula.shipment_out_export_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Export', 'export', 'tryton-ok', True),
|
||||
])
|
||||
export = StateTransition()
|
||||
|
||||
def transition_export(self):
|
||||
ShipmentOut = Pool().get('stock.shipment.out')
|
||||
|
||||
shipments = self.start.shipments
|
||||
if shipments:
|
||||
ShipmentOut.generate_systemlogics_modula(shipments)
|
||||
return 'end'
|
||||
|
|
6
view/shipment_out_export_form.xml
Normal file
6
view/shipment_out_export_form.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part systemlogics_modula module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<form string="Export Shipments Out to Modula">
|
||||
<field name="shipments" colspan="4"/>
|
||||
</form>
|
Loading…
Reference in a new issue