Minor fixes and update version
This commit is contained in:
parent
ce6a33c193
commit
78948ed262
|
@ -24,11 +24,12 @@ class SaleAccountMovesStart(ModelView):
|
|||
class SaleAccountMoves(Wizard):
|
||||
'Sale Account Moves'
|
||||
__name__ = 'sale_pos.sale_account_moves'
|
||||
start = StateView('sale_pos.sale_account_moves.start',
|
||||
start = StateView(
|
||||
'sale_pos.sale_account_moves.start',
|
||||
'sale_pos.sale_account_moves_start_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Print', 'print_', 'tryton-print', default=True),
|
||||
])
|
||||
])
|
||||
print_ = StateReport('sale_pos.sale_account_moves_report')
|
||||
|
||||
def do_print_(self, action):
|
||||
|
|
|
@ -9,8 +9,8 @@ from trytond.pyson import Eval
|
|||
class SaleDevice(ModelSQL, ModelView):
|
||||
'Sale Device'
|
||||
__name__ = 'sale.device'
|
||||
name = fields.Char('Device Name', required=True, select=True)
|
||||
code = fields.Char('Code', select=True)
|
||||
name = fields.Char('Device Name', required=True)
|
||||
code = fields.Char('Code')
|
||||
shop = fields.Many2One('sale.shop', 'Shop', required=True)
|
||||
company = fields.Function(fields.Many2One('company.company', 'Company',),
|
||||
'get_company', searcher='search_company')
|
||||
|
@ -56,7 +56,7 @@ class SaleDeviceStatementJournal(ModelSQL):
|
|||
__name__ = 'sale.device.account.statement.journal'
|
||||
_table = 'sale_device_account_statement_journal'
|
||||
device = fields.Many2One('sale.device', 'Sale Device',
|
||||
ondelete='CASCADE', select=True, required=True)
|
||||
ondelete='CASCADE', required=True)
|
||||
journal = fields.Many2One('account.statement.journal', 'Statement Journal',
|
||||
ondelete='RESTRICT', required=True)
|
||||
|
||||
|
|
|
@ -39,8 +39,7 @@ class Invoice(metaclass=PoolMeta):
|
|||
if (invoice.type == 'out'
|
||||
and not invoice.company.cancel_invoice_out):
|
||||
raise AccessError(
|
||||
gettext('account_invoice'
|
||||
'.msg_invoice_customer_cancel_move',
|
||||
gettext('account_invoice.msg_invoice_customer_cancel_move',
|
||||
invoice=invoice.rec_name))
|
||||
invoice.cancel_move = invoice.move.cancel()
|
||||
to_save.append(invoice)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains
|
||||
# the full copyright notices and license terms.
|
||||
from decimal import Decimal
|
||||
|
||||
from trytond.model import fields, ModelSQL, DeactivableMixin
|
||||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.modules.product import price_digits
|
||||
|
@ -116,4 +117,3 @@ class Template(metaclass=PoolMeta):
|
|||
|
||||
class Category(DeactivableMixin, metaclass=PoolMeta):
|
||||
__name__ = 'product.category'
|
||||
|
||||
|
|
4
sale.py
4
sale.py
|
@ -6,7 +6,7 @@ from decimal import Decimal
|
|||
from datetime import datetime, date, timedelta
|
||||
from itertools import chain
|
||||
from sql import Null, Table, With
|
||||
from sql.operators import NotIn, Or
|
||||
from sql.operators import NotIn
|
||||
from sql.aggregate import Sum, Count
|
||||
from sql.conditionals import Case, Coalesce
|
||||
|
||||
|
@ -2048,4 +2048,4 @@ class DeleteSalesDraft(Wizard):
|
|||
if len(sales_delete) > 1:
|
||||
cursor.execute("DELETE from sale_sale WHERE \
|
||||
id in (%s)" % (', '.join(sales_delete)))
|
||||
return 'end'
|
||||
return 'end'
|
||||
|
|
8
shop.py
8
shop.py
|
@ -20,11 +20,13 @@ class SaleShop(metaclass=PoolMeta):
|
|||
__name__ = 'sale.shop'
|
||||
party = fields.Many2One('party.party', 'Default Party')
|
||||
invoice_sequence = fields.Many2One('ir.sequence.strict', 'Invoice Sequence')
|
||||
credit_note_sequence = fields.Many2One('ir.sequence.strict', 'Credit Note Sequence')
|
||||
credit_note_sequence = fields.Many2One('ir.sequence.strict',
|
||||
'Credit Note Sequence')
|
||||
self_pick_up = fields.Boolean('Default Self Pick Up',
|
||||
help='The goods are picked up by the customer before the sale, so no '
|
||||
'shipment is created.')
|
||||
pos_authorization = fields.Many2One('account.invoice.authorization', 'Pos Authorization', domain=[
|
||||
pos_authorization = fields.Many2One('account.invoice.authorization',
|
||||
'POS Authorization', domain=[
|
||||
('kind', '=', 'P'),
|
||||
('company', '=', Eval('company')),
|
||||
])
|
||||
|
@ -106,7 +108,7 @@ class ShopDailySummaryReport(Report):
|
|||
Line = pool.get('sale.line')
|
||||
Invoice = pool.get('account.invoice')
|
||||
Company = pool.get('company.company')
|
||||
fixed_hour = time(6, 0)
|
||||
fixed_hour = time(6, 0)
|
||||
|
||||
cursor = Transaction().connection.cursor()
|
||||
sale = Sale.__table__()
|
||||
|
|
35
statement.py
35
statement.py
|
@ -25,8 +25,9 @@ class Journal(metaclass=PoolMeta):
|
|||
|
||||
class Statement(metaclass=PoolMeta):
|
||||
__name__ = 'account.statement'
|
||||
users = fields.Function(fields.One2Many('res.user', None, 'Users'),
|
||||
'get_users', setter='set_users', searcher='search_users')
|
||||
users = fields.Function(fields.One2Many(
|
||||
'res.user', None, 'Users'),
|
||||
'get_users', setter='set_users', searcher='search_users')
|
||||
turn = fields.Integer('Turn', states={'readonly': True})
|
||||
count_money = fields.One2Many(
|
||||
'sale_pos.money_count', 'statement', 'Count Money')
|
||||
|
@ -75,7 +76,7 @@ class Statement(metaclass=PoolMeta):
|
|||
|
||||
def get_amount_difference(self, name):
|
||||
res = 0
|
||||
amount = sum(l.amount for l in self.lines)
|
||||
amount = sum(li.amount for li in self.lines)
|
||||
if self.total_money is not None:
|
||||
res = self.total_money - amount
|
||||
return res
|
||||
|
@ -331,15 +332,17 @@ class OpenStatementDone(ModelView):
|
|||
class OpenStatement(Wizard):
|
||||
'Open Statement'
|
||||
__name__ = 'open.statement'
|
||||
start = StateView('open.statement.start',
|
||||
start = StateView(
|
||||
'open.statement.start',
|
||||
'sale_pos.open_statement_start', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Ok', 'create_', 'tryton-ok', default=True),
|
||||
])
|
||||
create_ = StateTransition()
|
||||
done = StateView('open.statement.done',
|
||||
done = StateView(
|
||||
'open.statement.done',
|
||||
'sale_pos.open_statement_done', [
|
||||
Button('Done', 'end', 'tryton-ok', default=True),
|
||||
Button('Done', 'end', 'tryton-ok', default=True),
|
||||
])
|
||||
|
||||
@classmethod
|
||||
|
@ -446,16 +449,18 @@ class CloseStatementDone(ModelView):
|
|||
class CloseStatement(Wizard):
|
||||
'Close Statement'
|
||||
__name__ = 'close.statement'
|
||||
start = StateView('close.statement.start',
|
||||
'sale_pos.close_statement_start', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Ok', 'validate', 'tryton-ok', default=True),
|
||||
])
|
||||
start = StateView(
|
||||
'close.statement.start',
|
||||
'sale_pos.close_statement_start', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Ok', 'validate', 'tryton-ok', default=True),
|
||||
])
|
||||
validate = StateTransition()
|
||||
done = StateView('close.statement.done',
|
||||
'sale_pos.close_statement_done', [
|
||||
Button('Done', 'end', 'tryton-ok', default=True),
|
||||
])
|
||||
done = StateView(
|
||||
'close.statement.done',
|
||||
'sale_pos.close_statement_done', [
|
||||
Button('Done', 'end', 'tryton-ok', default=True),
|
||||
])
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=6.0.10
|
||||
version=6.0.11
|
||||
depends:
|
||||
account
|
||||
account_statement
|
||||
|
|
1
user.py
1
user.py
|
@ -1,7 +1,6 @@
|
|||
# This file is part of the sale_payment module for Tryton.
|
||||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond import backend
|
||||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
|
|
Loading…
Reference in New Issue