mirror of
https://bitbucket.org/presik/trytonpsk-sale_pos.git
synced 2023-12-14 07:13:02 +01:00
Minor fixes and update version
This commit is contained in:
parent
ce6a33c193
commit
78948ed262
9 changed files with 36 additions and 30 deletions
|
@ -24,11 +24,12 @@ class SaleAccountMovesStart(ModelView):
|
||||||
class SaleAccountMoves(Wizard):
|
class SaleAccountMoves(Wizard):
|
||||||
'Sale Account Moves'
|
'Sale Account Moves'
|
||||||
__name__ = 'sale_pos.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', [
|
'sale_pos.sale_account_moves_start_view_form', [
|
||||||
Button('Cancel', 'end', 'tryton-cancel'),
|
Button('Cancel', 'end', 'tryton-cancel'),
|
||||||
Button('Print', 'print_', 'tryton-print', default=True),
|
Button('Print', 'print_', 'tryton-print', default=True),
|
||||||
])
|
])
|
||||||
print_ = StateReport('sale_pos.sale_account_moves_report')
|
print_ = StateReport('sale_pos.sale_account_moves_report')
|
||||||
|
|
||||||
def do_print_(self, action):
|
def do_print_(self, action):
|
||||||
|
|
|
@ -9,8 +9,8 @@ from trytond.pyson import Eval
|
||||||
class SaleDevice(ModelSQL, ModelView):
|
class SaleDevice(ModelSQL, ModelView):
|
||||||
'Sale Device'
|
'Sale Device'
|
||||||
__name__ = 'sale.device'
|
__name__ = 'sale.device'
|
||||||
name = fields.Char('Device Name', required=True, select=True)
|
name = fields.Char('Device Name', required=True)
|
||||||
code = fields.Char('Code', select=True)
|
code = fields.Char('Code')
|
||||||
shop = fields.Many2One('sale.shop', 'Shop', required=True)
|
shop = fields.Many2One('sale.shop', 'Shop', required=True)
|
||||||
company = fields.Function(fields.Many2One('company.company', 'Company',),
|
company = fields.Function(fields.Many2One('company.company', 'Company',),
|
||||||
'get_company', searcher='search_company')
|
'get_company', searcher='search_company')
|
||||||
|
@ -56,7 +56,7 @@ class SaleDeviceStatementJournal(ModelSQL):
|
||||||
__name__ = 'sale.device.account.statement.journal'
|
__name__ = 'sale.device.account.statement.journal'
|
||||||
_table = 'sale_device_account_statement_journal'
|
_table = 'sale_device_account_statement_journal'
|
||||||
device = fields.Many2One('sale.device', 'Sale Device',
|
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',
|
journal = fields.Many2One('account.statement.journal', 'Statement Journal',
|
||||||
ondelete='RESTRICT', required=True)
|
ondelete='RESTRICT', required=True)
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,7 @@ class Invoice(metaclass=PoolMeta):
|
||||||
if (invoice.type == 'out'
|
if (invoice.type == 'out'
|
||||||
and not invoice.company.cancel_invoice_out):
|
and not invoice.company.cancel_invoice_out):
|
||||||
raise AccessError(
|
raise AccessError(
|
||||||
gettext('account_invoice'
|
gettext('account_invoice.msg_invoice_customer_cancel_move',
|
||||||
'.msg_invoice_customer_cancel_move',
|
|
||||||
invoice=invoice.rec_name))
|
invoice=invoice.rec_name))
|
||||||
invoice.cancel_move = invoice.move.cancel()
|
invoice.cancel_move = invoice.move.cancel()
|
||||||
to_save.append(invoice)
|
to_save.append(invoice)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# The COPYRIGHT file at the top level of this repository contains
|
# The COPYRIGHT file at the top level of this repository contains
|
||||||
# the full copyright notices and license terms.
|
# the full copyright notices and license terms.
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
from trytond.model import fields, ModelSQL, DeactivableMixin
|
from trytond.model import fields, ModelSQL, DeactivableMixin
|
||||||
from trytond.pool import PoolMeta, Pool
|
from trytond.pool import PoolMeta, Pool
|
||||||
from trytond.modules.product import price_digits
|
from trytond.modules.product import price_digits
|
||||||
|
@ -116,4 +117,3 @@ class Template(metaclass=PoolMeta):
|
||||||
|
|
||||||
class Category(DeactivableMixin, metaclass=PoolMeta):
|
class Category(DeactivableMixin, metaclass=PoolMeta):
|
||||||
__name__ = 'product.category'
|
__name__ = 'product.category'
|
||||||
|
|
||||||
|
|
2
sale.py
2
sale.py
|
@ -6,7 +6,7 @@ from decimal import Decimal
|
||||||
from datetime import datetime, date, timedelta
|
from datetime import datetime, date, timedelta
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from sql import Null, Table, With
|
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.aggregate import Sum, Count
|
||||||
from sql.conditionals import Case, Coalesce
|
from sql.conditionals import Case, Coalesce
|
||||||
|
|
||||||
|
|
6
shop.py
6
shop.py
|
@ -20,11 +20,13 @@ class SaleShop(metaclass=PoolMeta):
|
||||||
__name__ = 'sale.shop'
|
__name__ = 'sale.shop'
|
||||||
party = fields.Many2One('party.party', 'Default Party')
|
party = fields.Many2One('party.party', 'Default Party')
|
||||||
invoice_sequence = fields.Many2One('ir.sequence.strict', 'Invoice Sequence')
|
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',
|
self_pick_up = fields.Boolean('Default Self Pick Up',
|
||||||
help='The goods are picked up by the customer before the sale, so no '
|
help='The goods are picked up by the customer before the sale, so no '
|
||||||
'shipment is created.')
|
'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'),
|
('kind', '=', 'P'),
|
||||||
('company', '=', Eval('company')),
|
('company', '=', Eval('company')),
|
||||||
])
|
])
|
||||||
|
|
35
statement.py
35
statement.py
|
@ -25,8 +25,9 @@ class Journal(metaclass=PoolMeta):
|
||||||
|
|
||||||
class Statement(metaclass=PoolMeta):
|
class Statement(metaclass=PoolMeta):
|
||||||
__name__ = 'account.statement'
|
__name__ = 'account.statement'
|
||||||
users = fields.Function(fields.One2Many('res.user', None, 'Users'),
|
users = fields.Function(fields.One2Many(
|
||||||
'get_users', setter='set_users', searcher='search_users')
|
'res.user', None, 'Users'),
|
||||||
|
'get_users', setter='set_users', searcher='search_users')
|
||||||
turn = fields.Integer('Turn', states={'readonly': True})
|
turn = fields.Integer('Turn', states={'readonly': True})
|
||||||
count_money = fields.One2Many(
|
count_money = fields.One2Many(
|
||||||
'sale_pos.money_count', 'statement', 'Count Money')
|
'sale_pos.money_count', 'statement', 'Count Money')
|
||||||
|
@ -75,7 +76,7 @@ class Statement(metaclass=PoolMeta):
|
||||||
|
|
||||||
def get_amount_difference(self, name):
|
def get_amount_difference(self, name):
|
||||||
res = 0
|
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:
|
if self.total_money is not None:
|
||||||
res = self.total_money - amount
|
res = self.total_money - amount
|
||||||
return res
|
return res
|
||||||
|
@ -331,15 +332,17 @@ class OpenStatementDone(ModelView):
|
||||||
class OpenStatement(Wizard):
|
class OpenStatement(Wizard):
|
||||||
'Open Statement'
|
'Open Statement'
|
||||||
__name__ = 'open.statement'
|
__name__ = 'open.statement'
|
||||||
start = StateView('open.statement.start',
|
start = StateView(
|
||||||
|
'open.statement.start',
|
||||||
'sale_pos.open_statement_start', [
|
'sale_pos.open_statement_start', [
|
||||||
Button('Cancel', 'end', 'tryton-cancel'),
|
Button('Cancel', 'end', 'tryton-cancel'),
|
||||||
Button('Ok', 'create_', 'tryton-ok', default=True),
|
Button('Ok', 'create_', 'tryton-ok', default=True),
|
||||||
])
|
])
|
||||||
create_ = StateTransition()
|
create_ = StateTransition()
|
||||||
done = StateView('open.statement.done',
|
done = StateView(
|
||||||
|
'open.statement.done',
|
||||||
'sale_pos.open_statement_done', [
|
'sale_pos.open_statement_done', [
|
||||||
Button('Done', 'end', 'tryton-ok', default=True),
|
Button('Done', 'end', 'tryton-ok', default=True),
|
||||||
])
|
])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -446,16 +449,18 @@ class CloseStatementDone(ModelView):
|
||||||
class CloseStatement(Wizard):
|
class CloseStatement(Wizard):
|
||||||
'Close Statement'
|
'Close Statement'
|
||||||
__name__ = 'close.statement'
|
__name__ = 'close.statement'
|
||||||
start = StateView('close.statement.start',
|
start = StateView(
|
||||||
'sale_pos.close_statement_start', [
|
'close.statement.start',
|
||||||
Button('Cancel', 'end', 'tryton-cancel'),
|
'sale_pos.close_statement_start', [
|
||||||
Button('Ok', 'validate', 'tryton-ok', default=True),
|
Button('Cancel', 'end', 'tryton-cancel'),
|
||||||
])
|
Button('Ok', 'validate', 'tryton-ok', default=True),
|
||||||
|
])
|
||||||
validate = StateTransition()
|
validate = StateTransition()
|
||||||
done = StateView('close.statement.done',
|
done = StateView(
|
||||||
'sale_pos.close_statement_done', [
|
'close.statement.done',
|
||||||
Button('Done', 'end', 'tryton-ok', default=True),
|
'sale_pos.close_statement_done', [
|
||||||
])
|
Button('Done', 'end', 'tryton-ok', default=True),
|
||||||
|
])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[tryton]
|
[tryton]
|
||||||
version=6.0.10
|
version=6.0.11
|
||||||
depends:
|
depends:
|
||||||
account
|
account
|
||||||
account_statement
|
account_statement
|
||||||
|
|
1
user.py
1
user.py
|
@ -1,7 +1,6 @@
|
||||||
# This file is part of the sale_payment module for Tryton.
|
# This file is part of the sale_payment module for Tryton.
|
||||||
# The COPYRIGHT file at the top level of this repository contains the full
|
# The COPYRIGHT file at the top level of this repository contains the full
|
||||||
# copyright notices and license terms.
|
# copyright notices and license terms.
|
||||||
from trytond import backend
|
|
||||||
from trytond.model import fields
|
from trytond.model import fields
|
||||||
from trytond.pool import PoolMeta
|
from trytond.pool import PoolMeta
|
||||||
from trytond.pyson import Eval
|
from trytond.pyson import Eval
|
||||||
|
|
Loading…
Reference in a new issue