Release v6.0

This commit is contained in:
wilson gomez 2021-07-22 17:35:39 -05:00
parent 4fb18c1551
commit b5547ce5bc
12 changed files with 49 additions and 38 deletions

View File

@ -2,11 +2,11 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
import restaurant
import sale
import production
import product
import invoice
from . import restaurant
from . import sale
from . import production
from . import product
from . import invoice
def register():

3
bom.py
View File

@ -5,9 +5,6 @@ from trytond.pool import PoolMeta
from decimal import Decimal
__all__ = ['BOM']
def round_dec(number):
return Decimal(number.quantize(Decimal('.01')))

13
exceptions.py Normal file
View File

@ -0,0 +1,13 @@
# 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.exceptions import UserError, UserWarning
from trytond.model.exceptions import ValidationError
class PayValidationError(ValidationError):
pass
class ProductionValidationWarning(UserWarning):
pass

View File

@ -2,8 +2,6 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool, PoolMeta
__all__ = ['InvoiceLine']
class InvoiceLine(metaclass=PoolMeta):
__name__ = 'account.invoice.line'

16
message.xml Normal file
View File

@ -0,0 +1,16 @@
<?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 grouped="1">
<record model="ir.message" id="msg_product_without_bom">
<field name="text">The product '%(product)s' has no production bom </field>
</record>
<record model="ir.message" id="msg_message_error">
<field name="text">Error: %s</field>
</record>
<record model="ir.message" id="msg_party_not_account_receivable">
<field name="text">Party %s has no any account receivable defined. Please, assign one.</field>
</record>
</data>
</tryton>

View File

@ -3,8 +3,6 @@
from trytond.model import fields, ModelSQL
from trytond.pool import PoolMeta
__all__ = ['Product', 'ProductMixOption']
class Product(metaclass=PoolMeta):
__name__ = 'product.product'

View File

@ -6,8 +6,6 @@ from trytond.transaction import Transaction
from decimal import Decimal
from trytond.pool import PoolMeta, Pool
__all__ = ['Production']
def round_dec(number):
return Decimal(number.quantize(Decimal('.01')))

View File

@ -4,8 +4,6 @@
from trytond.model import ModelView, ModelSQL, fields
from trytond.pool import Pool
__all__ = ['SaleShopTable', 'Reservation']
TYPE_VEHICLE = [
('', ''),
('motorcycle', 'Motorcycle'),

31
sale.py
View File

@ -9,8 +9,8 @@ from trytond.pyson import Eval
from trytond.transaction import Transaction
from trytond.wizard import Wizard
from decimal import Decimal
__all__ = ['Sale', 'Shop', 'SaleMove', 'SaleForceDraft']
from trytond.i18n import gettext
from .exceptions import PayValidationError, ProductionValidationWarning
KIND = [
('', ''),
@ -58,11 +58,6 @@ class Sale(metaclass=PoolMeta):
@classmethod
def __setup__(cls):
super(Sale, cls).__setup__()
cls._error_messages.update({
'product_without_bom': (
"The product '%(product)s' has no production bom"),
'message_error': 'Error: %s',
},)
@staticmethod
def default_order_status():
@ -88,17 +83,17 @@ class Sale(metaclass=PoolMeta):
('sale_device', '=', sale.sale_device),
], order=[('date', 'DESC')])
if not statements:
cls.raise_user_error(
'message_error',
'A draft statement payments has not been created.'
)
raise PayValidationError(
gettext('sale_pos_frontend_rest.msg_message_error', s='A draft statement payments has not been created.'))
if not sale.number:
cls.set_number([sale])
account = (sale.party.account_receivable and sale.party.account_receivable.id
or cls.raise_user_error('message_error', 'Party %s has no any \
account receivable defined. Please, assign one.' % (sale.party.name)))
if not sale.party.account_receivable:
raise PayValidationError(
gettext('sale_pos_frontend_rest.msg_party_not_account_receivable', s=sale.party.name))
account = sale.party.account_receivable.id
payment = StatementLine(
statement=statements[0].id,
@ -206,11 +201,9 @@ class Sale(metaclass=PoolMeta):
if not boms:
continue
warning_name = '%s.product.without_bom' % line
cls.raise_user_warning(
warning_name, 'product_without_bom', {
'product': line.product.rec_name,
})
raise ProductionValidationWarning(
gettext('sale_pos_frontend_rest.msg_msg_product_without_bom', product=line.product.rec_name))
else:
bom_ = boms[0]
locations = Location.search([

View File

@ -1,5 +1,5 @@
[tryton]
version=5.0.3
version=6.0.0
depends:
ir
sale

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- This file is part sale_pos module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<tree sequence="sequence" editable="bottom">
<tree sequence="sequence" editable="1">
<field name="product" view_ids="sale.product_view_list_sale_line"/>
<field name="quantity"/>
<field name="unit"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- This file is part sale_shop module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<tree editable="bottom">
<tree editable="1">
<field name="name"/>
<field name="capacity"/>
<field name="sale"/>