Compare commits
5 Commits
ccda3c7734
...
8.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ad6f9965b | |||
| f4b99e0ea9 | |||
| e130ae7f9d | |||
| 5e18fa68a3 | |||
| d0f414550b |
39
__init__.py
39
__init__.py
@@ -1,39 +0,0 @@
|
||||
# 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.pool import Pool
|
||||
from . import device
|
||||
from . import sale
|
||||
from . import statement
|
||||
from . import user
|
||||
from . import configuration_statement
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
statement.Journal,
|
||||
statement.Statement,
|
||||
statement.Line,
|
||||
statement.StatementLine,
|
||||
statement.LinesInvoiceToPay,
|
||||
device.SaleDevice,
|
||||
user.User,
|
||||
device.SaleDeviceStatementJournal,
|
||||
sale.Sale,
|
||||
sale.SalePaymentForm,
|
||||
sale.ChangePaymentMethodForm,
|
||||
statement.OpenStatementStart,
|
||||
statement.OpenStatementDone,
|
||||
statement.CloseStatementStart,
|
||||
statement.CloseStatementDone,
|
||||
statement.PayInvoiceSupplierStart,
|
||||
configuration_statement.Configuration,
|
||||
module='sale_payment', type_='model')
|
||||
Pool.register(
|
||||
sale.WizardSalePayment,
|
||||
sale.ChangePaymentMethod,
|
||||
sale.WizardSaleReconcile,
|
||||
statement.OpenStatement,
|
||||
statement.CloseStatement,
|
||||
statement.PayInvoiceSupplier,
|
||||
module='sale_payment', type_='wizard')
|
||||
|
||||
@@ -19,7 +19,7 @@ class SaleDevice(ModelSQL, ModelView):
|
||||
journals = fields.Many2Many('sale.device.account.statement.journal',
|
||||
'device', 'journal', 'Journals', depends=['company'],
|
||||
domain=[
|
||||
('company', '=', Eval('company')),
|
||||
('company', '=', Eval('company', -1)),
|
||||
]
|
||||
)
|
||||
journal = fields.Many2One('account.statement.journal', "Default Journal",
|
||||
|
||||
13
sale.py
13
sale.py
@@ -30,7 +30,7 @@ class Sale(metaclass=PoolMeta):
|
||||
'get_residual_amount',
|
||||
searcher='search_residual_amount')
|
||||
sale_device = fields.Many2One('sale.device', 'Sale Device',
|
||||
domain=[('shop', '=', Eval('shop'))],
|
||||
domain=[('shop', '=', Eval('shop', -1))],
|
||||
depends=['shop'], states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
})
|
||||
@@ -40,9 +40,12 @@ class Sale(metaclass=PoolMeta):
|
||||
super(Sale, cls).__setup__()
|
||||
cls._buttons.update({
|
||||
'wizard_sale_payment': {
|
||||
'invisible': Eval('state') == 'done',
|
||||
'readonly': Not(Bool(Eval('lines'))),
|
||||
},
|
||||
'invisible': (Eval('state') == 'done') | (Eval(
|
||||
'residual_amount', 0) == 0),
|
||||
'readonly': Not(Bool(Eval('lines'))) | (Eval(
|
||||
'residual_amount', 0) == 0),
|
||||
'depends': ['state', 'residual_amount']
|
||||
},
|
||||
'wizard_change_payment_method': {},
|
||||
})
|
||||
|
||||
@@ -225,7 +228,7 @@ class ChangePaymentMethodForm(ModelView):
|
||||
'Allowed Statement', readonly=True)
|
||||
payment = fields.Many2One(
|
||||
'account.statement.line', "Payment", required=True,
|
||||
domain=[('sale', '=', Eval('sale'))])
|
||||
domain=[('sale', '=', Eval('sale', -1))])
|
||||
|
||||
|
||||
class ChangePaymentMethod(Wizard):
|
||||
|
||||
4
sale.xml
4
sale.xml
@@ -13,7 +13,7 @@ copyright notices and license terms. -->
|
||||
<record model="ir.action.act_window" id="act_payment_form">
|
||||
<field name="name">Payments</field>
|
||||
<field name="res_model">account.statement.line</field>
|
||||
<field name="domain" eval="[If(Eval('active_ids', []) == [Eval('active_id')], ('sale', '=', Eval('active_id')), ('sale', 'in', Eval('active_ids')))]" pyson="1"/>
|
||||
<field name="domain" eval="[If(Eval('active_ids', []) == [Eval('active_id'), -1], ('sale', '=', Eval('active_id', -1)), ('sale', 'in', Eval('active_ids', [])))]" pyson="1"/>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="act_open_payment_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
@@ -31,7 +31,7 @@ copyright notices and license terms. -->
|
||||
<field name="name">sale_payment_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.wizard" id="wizard_sale_change_payment_method">
|
||||
<record model="ir.action.wizard" id="wizard_sale_change_payment_method">
|
||||
<field name="name">Change Payment Method</field>
|
||||
<field name="wiz_name">sale.change_payment_method</field>
|
||||
</record>
|
||||
|
||||
30
tryton.cfg
30
tryton.cfg
@@ -1,5 +1,5 @@
|
||||
[tryton]
|
||||
version=7.6.0
|
||||
version=8.0.0
|
||||
depends:
|
||||
account_statement
|
||||
sale_shop
|
||||
@@ -9,3 +9,31 @@ xml:
|
||||
sale.xml
|
||||
user.xml
|
||||
message.xml
|
||||
|
||||
[register]
|
||||
model:
|
||||
statement.Journal
|
||||
statement.Statement
|
||||
statement.Line
|
||||
statement.StatementLine
|
||||
statement.LinesInvoiceToPay
|
||||
device.SaleDevice
|
||||
user.User
|
||||
device.SaleDeviceStatementJournal
|
||||
sale.Sale
|
||||
sale.SalePaymentForm
|
||||
sale.ChangePaymentMethodForm
|
||||
statement.OpenStatementStart
|
||||
statement.OpenStatementDone
|
||||
statement.CloseStatementStart
|
||||
statement.CloseStatementDone
|
||||
statement.PayInvoiceSupplierStart
|
||||
configuration_statement.Configuration
|
||||
|
||||
wizards:
|
||||
sale.WizardSalePayment
|
||||
sale.ChangePaymentMethod
|
||||
sale.WizardSaleReconcile
|
||||
statement.OpenStatement
|
||||
statement.CloseStatement
|
||||
statement.PayInvoiceSupplier
|
||||
|
||||
9
user.py
9
user.py
@@ -12,14 +12,15 @@ __all__ = ['User']
|
||||
|
||||
class User(metaclass=PoolMeta):
|
||||
__name__ = "res.user"
|
||||
sale_device = fields.Many2One('sale.device', 'Sale Device',
|
||||
domain=[('shop', '=', Eval('shop'))],
|
||||
depends=['shop']
|
||||
)
|
||||
sale_device = fields.Many2One(
|
||||
'sale.device', 'Sale Device', domain=[
|
||||
('shop', '=', Eval('shop', -1))
|
||||
], depends=['shop'])
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(User, cls).__setup__()
|
||||
cls._context_fields.insert(0, 'sale_device')
|
||||
if 'sale_device' not in cls._preferences_fields:
|
||||
cls._preferences_fields.extend([
|
||||
'sale_device',
|
||||
|
||||
Reference in New Issue
Block a user