add dash and update rental model
This commit is contained in:
parent
fa5fe43e66
commit
f248b631c1
|
@ -10,6 +10,8 @@ from . import sale
|
|||
from . import invoice
|
||||
from . import stock
|
||||
from . import equipment
|
||||
from . import dash
|
||||
|
||||
|
||||
|
||||
def register():
|
||||
|
@ -34,6 +36,9 @@ def register():
|
|||
stock.ShipmentOutReturn,
|
||||
stock.Move,
|
||||
equipment.RentalEquipment,
|
||||
dash.DashApp,
|
||||
dash.AppRental,
|
||||
|
||||
module='rental', type_='model')
|
||||
Pool.register(
|
||||
service.ServiceForceDraft,
|
||||
|
|
|
@ -146,6 +146,7 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('booking')
|
||||
#fix me
|
||||
def booking(cls, records):
|
||||
cls.set_number(records)
|
||||
for rec in records:
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# 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 PoolMeta
|
||||
from trytond.modules.dash.dash import DashAppBase
|
||||
|
||||
# cada clase que registro la debo declarar en _init,py
|
||||
class DashApp(metaclass=PoolMeta):
|
||||
__name__ = "dash.app"
|
||||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
origins = super(DashApp, cls)._get_origin()
|
||||
origins.extend(
|
||||
[
|
||||
"dash.app.rental",
|
||||
]
|
||||
)
|
||||
return origins
|
||||
|
||||
@classmethod
|
||||
def get_selection(cls):
|
||||
options = super(DashApp, cls).get_selection()
|
||||
options.extend(
|
||||
[
|
||||
("rental", "Rental"),
|
||||
]
|
||||
)
|
||||
return options
|
||||
|
||||
|
||||
class AppRental(DashAppBase):
|
||||
"Sale rental"
|
||||
__name__ = "dash.app.rental"
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?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="dash.app.rental" id="dash_app_rental">
|
||||
<field name="company">1</field>
|
||||
<field name="icon">th</field>
|
||||
<field name="kind">internal</field>
|
||||
</record>
|
||||
<record model="dash.app" id="app_rental">
|
||||
<field name="name">Sale rental</field>
|
||||
<field name="origin">dash.app.rental,1</field>
|
||||
<field name="active">True</field>
|
||||
<field name="app_name">rental</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</tryton>
|
3
setup.py
3
setup.py
|
@ -91,10 +91,9 @@ setup(name=name,
|
|||
'Natural Language :: English',
|
||||
'Natural Language :: Spanish',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: Implementation :: CPython',
|
||||
'Programming Language :: Python :: Implementation :: PyPy',
|
||||
'Topic :: Office/Business',
|
||||
|
|
14
stock.py
14
stock.py
|
@ -2,7 +2,7 @@
|
|||
# this repository contains the full copyright notices and license terms.
|
||||
from datetime import time
|
||||
|
||||
# from trytond.i18n import gettext
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import fields, ModelView, ModelSQL, Workflow
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.wizard import Wizard, StateView, StateTransition, Button
|
||||
|
@ -153,12 +153,12 @@ class ShipmentOutReturn(metaclass=PoolMeta):
|
|||
for move in shipment.incoming_moves:
|
||||
quantity = shipment.validate_product_quantity(move)
|
||||
if quantity < move.quantity:
|
||||
# raise UserError(gettext(
|
||||
# 'rental.msg_product_not_stock', product=move.product.name
|
||||
# ))
|
||||
raise UserError(
|
||||
'rental.msg_product_not_stock, ' + move.product.name
|
||||
)
|
||||
raise UserError(gettext(
|
||||
'rental.msg_product_not_stock', product=move.product.name
|
||||
))
|
||||
# raise UserError(
|
||||
# 'rental.msg_product_not_stock, ' + move.product.name
|
||||
# )
|
||||
super(ShipmentOutReturn, cls).receive(shipments)
|
||||
|
||||
def validate_product_quantity(self, move):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=6.0.1
|
||||
version=6.0.2
|
||||
depends:
|
||||
party
|
||||
company
|
||||
|
@ -7,6 +7,8 @@ depends:
|
|||
sale
|
||||
account_voucher
|
||||
maintenance
|
||||
dash
|
||||
# email
|
||||
xml:
|
||||
rental.xml
|
||||
configuration.xml
|
||||
|
@ -18,3 +20,4 @@ xml:
|
|||
invoice.xml
|
||||
stock.xml
|
||||
message.xml
|
||||
dash.xml
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?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. -->
|
||||
<tree editable="top">
|
||||
<tree editable="1">
|
||||
<field name="date"/>
|
||||
<field name="amount"/>
|
||||
<field name="issue"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?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. -->
|
||||
<tree editable="top">
|
||||
<tree editable="1">
|
||||
<field name="item"/>
|
||||
<field name="state_delivery"/>
|
||||
<field name="state_return"/>
|
||||
|
|
|
@ -106,7 +106,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<label name="date_return"/>
|
||||
<field name="date_return"/>
|
||||
<newline/>
|
||||
<separator string="Notifications" colspan="4" />
|
||||
<!-- <separator string="Notifications" name="notificatios" colspan="4" /> -->
|
||||
<label name="sended_expired_notificacion"/>
|
||||
<field name="sended_expired_notificacion"/>
|
||||
<label name="date_expired_notificacion"/>
|
||||
|
@ -115,7 +115,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="sended_deposit_notificacion"/>
|
||||
<label name="date_deposit_notificacion"/>
|
||||
<field name="date_deposit_notificacion"/>
|
||||
<separator string="Issues" colspan="4" />
|
||||
<!-- <separator string="Issues" name="issues" colspan="4" /> -->
|
||||
<label name="issues_presented"/>
|
||||
<field name="issues_presented" colspan="3"/>
|
||||
<label name="part_missing"/>
|
||||
|
|
Loading…
Reference in New Issue