merged multiple heads

This commit is contained in:
resteve 2016-03-28 23:23:15 +02:00
commit b8d225e6c6
14 changed files with 104 additions and 200 deletions

View File

@ -4,7 +4,6 @@
from trytond import backend from trytond import backend
from trytond.model import ModelSQL, ModelView, fields from trytond.model import ModelSQL, ModelView, fields
from trytond.pyson import Eval from trytond.pyson import Eval
from trytond.transaction import Transaction
__all__ = ['SaleDevice', 'SaleDeviceStatementJournal'] __all__ = ['SaleDevice', 'SaleDeviceStatementJournal']
@ -32,19 +31,16 @@ class SaleDevice(ModelSQL, ModelView):
@classmethod @classmethod
def __register__(cls, module_name): def __register__(cls, module_name):
TableHandler = backend.get('TableHandler') TableHandler = backend.get('TableHandler')
cursor = Transaction().cursor
old_table = 'sale_pos_device' old_table = 'sale_pos_device'
if TableHandler.table_exist(cursor, old_table): if TableHandler.table_exist(old_table):
TableHandler.table_rename(cursor, old_table, cls._table) TableHandler.table_rename(old_table, cls._table)
super(SaleDevice, cls).__register__(module_name) super(SaleDevice, cls).__register__(module_name)
@fields.depends('shop') @fields.depends('shop')
def on_change_shop(self): def on_change_shop(self):
return { self.company = self.shop.company.id if self.shop else None
'company': self.shop.company.id if self.shop else None
}
def get_company(self, name): def get_company(self, name):
return self.shop.company.id return self.shop.company.id
@ -66,12 +62,11 @@ class SaleDeviceStatementJournal(ModelSQL):
@classmethod @classmethod
def __register__(cls, module_name): def __register__(cls, module_name):
TableHandler = backend.get('TableHandler') TableHandler = backend.get('TableHandler')
cursor = Transaction().cursor table = TableHandler(cls, module_name)
table = TableHandler(cursor, cls, module_name)
old_table = 'sale_pos_device_account_statement_journal' old_table = 'sale_pos_device_account_statement_journal'
if TableHandler.table_exist(cursor, old_table): if TableHandler.table_exist(old_table):
TableHandler.table_rename(cursor, old_table, cls._table) TableHandler.table_rename(old_table, cls._table)
old_column = 'pos_device' old_column = 'pos_device'
new_column = 'device' new_column = 'device'

View File

@ -10,10 +10,22 @@ msgctxt "error:close.statement:"
msgid "Statement %s already closed.\n" msgid "Statement %s already closed.\n"
msgstr "Extracte %s ja tancat.\n" msgstr "Extracte %s ja tancat.\n"
msgctxt "error:close.statement:"
msgid "Statement %s already closed. \n"
msgstr "Extracto %s ya cerrado.\n"
msgctxt "error:close.statement:" msgctxt "error:close.statement:"
msgid "Statement %s closed.\n" msgid "Statement %s closed.\n"
msgstr "Extracte %s tancat.\n" msgstr "Extracte %s tancat.\n"
msgctxt "error:close.statement:"
msgid "Statement %s closed. \n"
msgstr "Extracte %s ja tancat.\n"
msgctxt "error:close.statement:"
msgid "Statement %s not found.\n"
msgstr "Extracte %s no trobat.\n"
msgctxt "error:close.statement:" msgctxt "error:close.statement:"
msgid "Statement %s not found. \n" msgid "Statement %s not found. \n"
msgstr "Extracte %s no trobat.\n" msgstr "Extracte %s no trobat.\n"
@ -26,6 +38,14 @@ msgctxt "error:open.statement:"
msgid "Statement %s already opened.\n" msgid "Statement %s already opened.\n"
msgstr "Extracte %s ja obert.\n" msgstr "Extracte %s ja obert.\n"
msgctxt "error:open.statement:"
msgid "Statement %s already opened. \n"
msgstr "Extracte %s ja obert.\n"
msgctxt "error:open.statement:"
msgid "Statement %s opened.\n"
msgstr "Extracte %s obert.\n"
msgctxt "error:open.statement:" msgctxt "error:open.statement:"
msgid "Statement %s opened. \n" msgid "Statement %s opened. \n"
msgstr "Extracte %s obert.\n" msgstr "Extracte %s obert.\n"
@ -41,7 +61,7 @@ msgstr "No podeu tenir dos usuaris amb el mateix identificador d'entrada."
msgctxt "error:sale.payment:" msgctxt "error:sale.payment:"
msgid "A customer invoice/refund from sale device has not been created." msgid "A customer invoice/refund from sale device has not been created."
msgstr "" msgstr ""
"Una factura / factura de devolució d'un terminal de venda no s'ha creat." "Una factura/devolució d'un terminal de venda no s'ha creat."
msgctxt "error:sale.payment:" msgctxt "error:sale.payment:"
msgid "A draft statement for \"%s\" payments has not been created." msgid "A draft statement for \"%s\" payments has not been created."
@ -57,6 +77,11 @@ msgctxt "error:sale.payment:"
msgid "You have not defined a sale device for your user." msgid "You have not defined a sale device for your user."
msgstr "No heu definit un terminal de venda per al vostre usuari." msgstr "No heu definit un terminal de venda per al vostre usuari."
msgctxt "error:sale.sale:"
msgid "A customer invoice/refund from sale device has not been created."
msgstr ""
"Una factura/devolució d'un terminal de venda no s'ha creat."
msgctxt "error:sale.sale:" msgctxt "error:sale.sale:"
msgid "Go to user preferences and select a shop (\"%s\")" msgid "Go to user preferences and select a shop (\"%s\")"
msgstr "Selecciona una botiga en les seves preferencies (\"%s\")." msgstr "Selecciona una botiga en les seves preferencies (\"%s\")."
@ -241,10 +266,6 @@ msgctxt "model:close.statement.start,name:"
msgid "Close Statement" msgid "Close Statement"
msgstr "Tanca extracte" msgstr "Tanca extracte"
msgctxt "model:ir.action,name:"
msgid "POS Device"
msgstr "Dispositiu TPV"
msgctxt "model:ir.action,name:act_sale_device" msgctxt "model:ir.action,name:act_sale_device"
msgid "Sale Device" msgid "Sale Device"
msgstr "Terminal de venda" msgstr "Terminal de venda"
@ -301,10 +322,6 @@ msgctxt "model:ir.sequence.type,name:"
msgid "Sale Pos" msgid "Sale Pos"
msgstr "Venta TPV" msgstr "Venta TPV"
msgctxt "model:ir.ui.menu,name:"
msgid "POS Devices"
msgstr "Dispositius TPV"
msgctxt "model:ir.ui.menu,name:menu_close_statement" msgctxt "model:ir.ui.menu,name:menu_close_statement"
msgid "Close Statements" msgid "Close Statements"
msgstr "Tanca extractes" msgstr "Tanca extractes"

View File

@ -220,7 +220,7 @@ msgstr "Pagos"
msgctxt "field:sale.sale,residual_amount:" msgctxt "field:sale.sale,residual_amount:"
msgid "Residual Amount" msgid "Residual Amount"
msgstr "Cambio" msgstr "Saldo"
msgctxt "field:sale.sale,sale_device:" msgctxt "field:sale.sale,sale_device:"
msgid "Sale Device" msgid "Sale Device"
@ -246,10 +246,6 @@ msgctxt "model:close.statement.start,name:"
msgid "Close Statement" msgid "Close Statement"
msgstr "Cerrar Estado de Cuenta" msgstr "Cerrar Estado de Cuenta"
msgctxt "model:ir.action,name:"
msgid "POS Device"
msgstr "Dispositivo POS"
msgctxt "model:ir.action,name:act_sale_device" msgctxt "model:ir.action,name:act_sale_device"
msgid "Sale Device" msgid "Sale Device"
msgstr "Terminal de Venta" msgstr "Terminal de Venta"
@ -306,10 +302,6 @@ msgctxt "model:ir.sequence.type,name:"
msgid "Sale Pos" msgid "Sale Pos"
msgstr "Venta TPV" msgstr "Venta TPV"
msgctxt "model:ir.ui.menu,name:"
msgid "POS Devices"
msgstr "Dispositivos POS"
msgctxt "model:ir.ui.menu,name:menu_close_statement" msgctxt "model:ir.ui.menu,name:menu_close_statement"
msgid "Close Statements" msgid "Close Statements"
msgstr "Cerrar Estados de Cuenta" msgstr "Cerrar Estados de Cuenta"

View File

@ -38,11 +38,6 @@ msgctxt "error:res.user:"
msgid "You can not have two users with the same login!" msgid "You can not have two users with the same login!"
msgstr "No puede tener dos usuarios con el mismo registro de entrada." msgstr "No puede tener dos usuarios con el mismo registro de entrada."
msgctxt "error:sale.payment:"
msgid "A customer invoice/refund from sale device has not been created."
msgstr ""
"Una factura/factura de devolución del terminal de venta no se ha creado."
msgctxt "error:sale.payment:" msgctxt "error:sale.payment:"
msgid "A draft statement for \"%s\" payments has not been created." msgid "A draft statement for \"%s\" payments has not been created."
msgstr "Un extracto borrador para \"%s\" pagos no se ha creado." msgstr "Un extracto borrador para \"%s\" pagos no se ha creado."
@ -57,6 +52,10 @@ msgctxt "error:sale.payment:"
msgid "You have not defined a sale device for your user." msgid "You have not defined a sale device for your user."
msgstr "No ha definido un terminal de venta para su usuario." msgstr "No ha definido un terminal de venta para su usuario."
msgctxt "error:sale.sale:"
msgid "A customer invoice/refund from sale device has not been created."
msgstr "Una factura/devolución del terminal de venta no se ha creado."
msgctxt "error:sale.sale:" msgctxt "error:sale.sale:"
msgid "Go to user preferences and select a shop (\"%s\")" msgid "Go to user preferences and select a shop (\"%s\")"
msgstr "Seleccione una tienda en sus preferencias (\"%s\")." msgstr "Seleccione una tienda en sus preferencias (\"%s\")."
@ -241,10 +240,6 @@ msgctxt "model:close.statement.start,name:"
msgid "Close Statement" msgid "Close Statement"
msgstr "Cerrar extracto" msgstr "Cerrar extracto"
msgctxt "model:ir.action,name:"
msgid "POS Device"
msgstr "Dispositivo TPV"
msgctxt "model:ir.action,name:act_sale_device" msgctxt "model:ir.action,name:act_sale_device"
msgid "Sale Device" msgid "Sale Device"
msgstr "Terminal de venta" msgstr "Terminal de venta"
@ -301,10 +296,6 @@ msgctxt "model:ir.sequence.type,name:"
msgid "Sale Pos" msgid "Sale Pos"
msgstr "Venta TPV" msgstr "Venta TPV"
msgctxt "model:ir.ui.menu,name:"
msgid "POS Devices"
msgstr "Dispositivos TPV"
msgctxt "model:ir.ui.menu,name:menu_close_statement" msgctxt "model:ir.ui.menu,name:menu_close_statement"
msgid "Close Statements" msgid "Close Statements"
msgstr "Cerrar extractos" msgstr "Cerrar extractos"
@ -382,12 +373,12 @@ msgid "Sale Payment Form"
msgstr "Formulario de pago de venta" msgstr "Formulario de pago de venta"
msgctxt "view:sale.sale:" msgctxt "view:sale.sale:"
msgid "Payments" msgid "Pay"
msgstr "Pagos" msgstr "Pagar"
msgctxt "view:sale.sale:" msgctxt "view:sale.sale:"
msgid "_Pay" msgid "Payments"
msgstr "_Pagar" msgstr "Pagos"
msgctxt "wizard_button:close.statement,done,end:" msgctxt "wizard_button:close.statement,done,end:"
msgid "Done" msgid "Done"

View File

@ -244,7 +244,7 @@ class WizardSaleReconcile(Wizard):
lines = [] lines = []
amount = Decimal('0.0') amount = Decimal('0.0')
for invoice in sale.invoices: for invoice in sale.invoices:
for line in Line.browse(invoice.get_lines_to_pay(None)): for line in invoice.lines_to_pay:
if not line.reconciliation: if not line.reconciliation:
lines.append(line) lines.append(line)
amount += line.debit - line.credit amount += line.debit - line.credit

View File

@ -7,7 +7,7 @@ copyright notices and license terms. -->
<record model="ir.ui.view" id="sale_view_form"> <record model="ir.ui.view" id="sale_view_form">
<field name="model">sale.sale</field> <field name="model">sale.sale</field>
<field name="type">form</field> <field name="type" eval="None"/>
<field name="inherit" ref="sale.sale_view_form"/> <field name="inherit" ref="sale.sale_view_form"/>
<field name="name">sale_form</field> <field name="name">sale_form</field>
</record> </record>

View File

@ -157,7 +157,6 @@ class OpenStatement(Wizard):
pool = Pool() pool = Pool()
User = pool.get('res.user') User = pool.get('res.user')
Statement = pool.get('account.statement') Statement = pool.get('account.statement')
Journal = pool.get('account.statement.journal')
user = Transaction().user user = Transaction().user
user = User(user) user = User(user)
@ -249,7 +248,6 @@ class CloseStatement(Wizard):
pool = Pool() pool = Pool()
User = pool.get('res.user') User = pool.get('res.user')
Statement = pool.get('account.statement') Statement = pool.get('account.statement')
Journal = pool.get('account.statement.journal')
user = Transaction().user user = Transaction().user
user = User(user) user = User(user)
@ -285,6 +283,7 @@ class CloseStatement(Wizard):
result += self.raise_user_error('not_statement_found', result += self.raise_user_error('not_statement_found',
error_args=(journal.rec_name,), error_args=(journal.rec_name,),
raise_exception=False) raise_exception=False)
if statements:
Statement.validate_statement(statements) Statement.validate_statement(statements)
self.result = result self.result = result
else: else:

View File

@ -8,7 +8,8 @@ copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_sale_statement_form"> <record model="ir.action.act_window" id="act_sale_statement_form">
<field name="name">Statements</field> <field name="name">Statements</field>
<field name="res_model">account.statement</field> <field name="res_model">account.statement</field>
<field name="domain">[('users', '=', Eval('_user'))]</field> <field name="domain" eval="[('users', '=', Eval('_user'))]"
pyson="1"/>
</record> </record>
<record model="ir.action.act_window.view" id="act_sale_statement_form_view1"> <record model="ir.action.act_window.view" id="act_sale_statement_form_view1">
<field name="sequence" eval="10"/> <field name="sequence" eval="10"/>
@ -24,21 +25,24 @@ copyright notices and license terms. -->
id="act_sale_statement_form_domain_draft"> id="act_sale_statement_form_domain_draft">
<field name="name">Draft</field> <field name="name">Draft</field>
<field name="sequence" eval="10"/> <field name="sequence" eval="10"/>
<field name="domain">[('state', '=', 'draft')]</field> <field name="domain" eval="[('state', '=', 'draft')]"
pyson="1"/>
<field name="act_window" ref="act_sale_statement_form"/> <field name="act_window" ref="act_sale_statement_form"/>
</record> </record>
<record model="ir.action.act_window.domain" <record model="ir.action.act_window.domain"
id="act_sale_statement_form_domain_validated"> id="act_sale_statement_form_domain_validated">
<field name="name">Validated</field> <field name="name">Validated</field>
<field name="sequence" eval="20"/> <field name="sequence" eval="20"/>
<field name="domain">[('state', '=', 'validated')]</field> <field name="domain" eval="[('state', '=', 'validated')]"
pyson="1"/>
<field name="act_window" ref="act_sale_statement_form"/> <field name="act_window" ref="act_sale_statement_form"/>
</record> </record>
<record model="ir.action.act_window.domain" <record model="ir.action.act_window.domain"
id="act_sale_statement_form_domain_posted"> id="act_sale_statement_form_domain_posted">
<field name="name">Posted</field> <field name="name">Posted</field>
<field name="sequence" eval="30"/> <field name="sequence" eval="30"/>
<field name="domain">[('state', '=', 'posted')]</field> <field name="domain" eval="[('state', '=', 'posted')]"
pyson="1"/>
<field name="act_window" ref="act_sale_statement_form"/> <field name="act_window" ref="act_sale_statement_form"/>
</record> </record>
<record model="ir.action.act_window.domain" <record model="ir.action.act_window.domain"
@ -48,7 +52,6 @@ copyright notices and license terms. -->
<field name="domain"></field> <field name="domain"></field>
<field name="act_window" ref="act_sale_statement_form"/> <field name="act_window" ref="act_sale_statement_form"/>
</record> </record>
<menuitem name="Statements" parent="sale.menu_sale" <menuitem name="Statements" parent="sale.menu_sale"
action="act_sale_statement_form" action="act_sale_statement_form"
id="menu_sale_statement" sequence="70"/> id="menu_sale_statement" sequence="70"/>

View File

@ -9,6 +9,12 @@ Imports::
>>> from decimal import Decimal >>> from decimal import Decimal
>>> from operator import attrgetter >>> from operator import attrgetter
>>> from proteus import config, Model, Wizard >>> from proteus import config, Model, Wizard
>>> from trytond.modules.company.tests.tools import create_company, \
... get_company
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
... create_chart, get_accounts, create_tax, set_tax_code
>>> from.trytond.modules.account_invoice.tests.tools import \
... set_fiscalyear_invoice_sequences, create_payment_term
>>> today = datetime.date.today() >>> today = datetime.date.today()
Create database:: Create database::
@ -18,36 +24,15 @@ Create database::
Install sale:: Install sale::
>>> Module = Model.get('ir.module.module') >>> Module = Model.get('ir.module')
>>> module, = Module.find([('name', '=', 'sale_payment')]) >>> module, = Module.find([('name', '=', 'sale_payment')])
>>> module.click('install') >>> module.click('install')
>>> Wizard('ir.module.module.install_upgrade').execute('upgrade') >>> Wizard('ir.module.install_upgrade').execute('upgrade')
Create company:: Create company::
>>> Currency = Model.get('currency.currency') >>> _ = create_company()
>>> CurrencyRate = Model.get('currency.currency.rate') >>> company = get_company()
>>> currencies = Currency.find([('code', '=', 'USD')])
>>> if not currencies:
... currency = Currency(name='U.S. Dollar', symbol='$', code='USD',
... rounding=Decimal('0.01'), mon_grouping='[3, 3, 0]',
... mon_decimal_point='.', mon_thousands_sep=',')
... currency.save()
... CurrencyRate(date=today + relativedelta(month=1, day=1),
... rate=Decimal('1.0'), currency=currency).save()
... else:
... currency, = currencies
>>> Company = Model.get('company.company')
>>> Party = Model.get('party.party')
>>> company_config = Wizard('company.company.config')
>>> company_config.execute('company')
>>> company = company_config.form
>>> party = Party(name='Dunder Mifflin')
>>> party.save()
>>> company.party = party
>>> company.currency = currency
>>> company_config.execute('add')
>>> company, = Company.find([])
Reload the context:: Reload the context::
@ -57,91 +42,28 @@ Reload the context::
Create fiscal year:: Create fiscal year::
>>> FiscalYear = Model.get('account.fiscalyear') >>> fiscalyear = set_fiscalyear_invoice_sequences(
>>> Sequence = Model.get('ir.sequence') ... create_fiscalyear(company))
>>> SequenceStrict = Model.get('ir.sequence.strict') >>> fiscalyear.click('create_period')
>>> fiscalyear = FiscalYear(name=str(today.year)) >>> period = fiscalyear.periods[0]
>>> fiscalyear.start_date = today + relativedelta(month=1, day=1)
>>> fiscalyear.end_date = today + relativedelta(month=12, day=31)
>>> fiscalyear.company = company
>>> post_move_seq = Sequence(name=str(today.year), code='account.move',
... company=company)
>>> post_move_seq.save()
>>> fiscalyear.post_move_sequence = post_move_seq
>>> invoice_seq = SequenceStrict(name=str(today.year),
... code='account.invoice', company=company)
>>> invoice_seq.save()
>>> fiscalyear.out_invoice_sequence = invoice_seq
>>> fiscalyear.in_invoice_sequence = invoice_seq
>>> fiscalyear.out_credit_note_sequence = invoice_seq
>>> fiscalyear.in_credit_note_sequence = invoice_seq
>>> fiscalyear.save()
>>> FiscalYear.create_period([fiscalyear.id], config.context)
Create chart of accounts:: Create chart of accounts::
>>> AccountTemplate = Model.get('account.account.template') >>> _ = create_chart(company)
>>> Account = Model.get('account.account') >>> accounts = get_accounts(company)
>>> Journal = Model.get('account.journal') >>> receivable = accounts['receivable']
>>> account_template, = AccountTemplate.find([('parent', '=', None)]) >>> revenue = accounts['revenue']
>>> create_chart = Wizard('account.create_chart') >>> expense = accounts['expense']
>>> create_chart.execute('account') >>> cash = accounts['cash']
>>> create_chart.form.account_template = account_template
>>> create_chart.form.company = company
>>> create_chart.execute('create_account')
>>> receivable, = Account.find([
... ('kind', '=', 'receivable'),
... ('company', '=', company.id),
... ])
>>> payable, = Account.find([
... ('kind', '=', 'payable'),
... ('company', '=', company.id),
... ])
>>> revenue, = Account.find([
... ('kind', '=', 'revenue'),
... ('company', '=', company.id),
... ])
>>> expense, = Account.find([
... ('kind', '=', 'expense'),
... ('company', '=', company.id),
... ])
>>> create_chart.form.account_receivable = receivable
>>> create_chart.form.account_payable = payable
>>> create_chart.execute('create_properties')
>>> cash, = Account.find([
... ('name', '=', 'Main Cash'),
... ('company', '=', company.id),
... ])
>>> account_tax, = Account.find([
... ('kind', '=', 'other'),
... ('company', '=', company.id),
... ('name', '=', 'Main Tax'),
... ])
Create tax:: Create tax::
>>> TaxCode = Model.get('account.tax.code') >>> tax = set_tax_code(create_tax(Decimal('.10')))
>>> Tax = Model.get('account.tax')
>>> tax = Tax()
>>> tax.name = 'Tax'
>>> tax.description = 'Tax'
>>> tax.type = 'percentage'
>>> tax.rate = Decimal('.10')
>>> tax.invoice_account = account_tax
>>> tax.credit_note_account = account_tax
>>> invoice_base_code = TaxCode(name='invoice base')
>>> invoice_base_code.save()
>>> tax.invoice_base_code = invoice_base_code
>>> invoice_tax_code = TaxCode(name='invoice tax')
>>> invoice_tax_code.save()
>>> tax.invoice_tax_code = invoice_tax_code
>>> credit_note_base_code = TaxCode(name='credit note base')
>>> credit_note_base_code.save()
>>> tax.credit_note_base_code = credit_note_base_code
>>> credit_note_tax_code = TaxCode(name='credit note tax')
>>> credit_note_tax_code.save()
>>> tax.credit_note_tax_code = credit_note_tax_code
>>> tax.save() >>> tax.save()
>>> invoice_base_code = tax.invoice_base_code
>>> invoice_tax_code = tax.invoice_tax_code
>>> credit_note_base_code = tax.credit_note_base_code
>>> credit_note_tax_code = tax.credit_note_tax_code
Create parties:: Create parties::
@ -181,16 +103,13 @@ Create product::
Create payment term:: Create payment term::
>>> PaymentTerm = Model.get('account.invoice.payment_term') >>> payment_term = create_payment_term()
>>> PaymentTermLine = Model.get('account.invoice.payment_term.line')
>>> payment_term = PaymentTerm(name='Direct')
>>> payment_term_line = PaymentTermLine(type='remainder', days=0)
>>> payment_term.lines.append(payment_term_line)
>>> payment_term.save() >>> payment_term.save()
Create a shop:: Create a shop::
>>> Shop = Model.get('sale.shop') >>> Shop = Model.get('sale.shop')
>>> Sequence = Model.get('ir.sequence')
>>> PriceList = Model.get('product.price_list') >>> PriceList = Model.get('product.price_list')
>>> Location = Model.get('stock.location') >>> Location = Model.get('stock.location')
>>> warehouse, = Location.find([ >>> warehouse, = Location.find([
@ -213,6 +132,7 @@ Create a shop::
Create journals:: Create journals::
>>> StatementJournal = Model.get('account.statement.journal') >>> StatementJournal = Model.get('account.statement.journal')
>>> Journal = Model.get('account.journal')
>>> sequence = Sequence(name='Satement', >>> sequence = Sequence(name='Satement',
... code='account.journal', ... code='account.journal',
... company=company, ... company=company,

View File

@ -1,27 +1,16 @@
#!/usr/bin/env python # This file is part of the sale_payment module for Tryton.
# This file is part 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.
import unittest import unittest
import doctest import doctest
import trytond.tests.test_tryton import trytond.tests.test_tryton
from trytond.tests.test_tryton import test_view, test_depends from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import doctest_setup, doctest_teardown from trytond.tests.test_tryton import doctest_setup, doctest_teardown
class SalePaymentTestCase(unittest.TestCase): class SalePaymentTestCase(ModuleTestCase):
'Test Sale Payment module' 'Test Sale Payment module'
module = 'sale_payment'
def setUp(self):
trytond.tests.test_tryton.install_module('sale_payment')
def test0005views(self):
'Test views'
test_view('sale_payment')
def test0006depends(self):
'Test depends'
test_depends()
def suite(): def suite():

View File

@ -1,5 +1,5 @@
[tryton] [tryton]
version=3.4.0 version=3.9.0
depends: depends:
account_statement account_statement
sale_shop sale_shop

View File

@ -5,7 +5,6 @@ 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
from trytond.transaction import Transaction
__all__ = ['User'] __all__ = ['User']
@ -30,8 +29,7 @@ class User:
@classmethod @classmethod
def __register__(cls, module_name): def __register__(cls, module_name):
TableHandler = backend.get('TableHandler') TableHandler = backend.get('TableHandler')
cursor = Transaction().cursor table = TableHandler(cls, module_name)
table = TableHandler(cursor, cls, module_name)
# Migrate from sale_pos 3.0 # Migrate from sale_pos 3.0
old_column = 'pos_device' old_column = 'pos_device'

View File

@ -6,13 +6,13 @@ copyright notices and license terms. -->
<data> <data>
<record model="ir.ui.view" id="user_view_form"> <record model="ir.ui.view" id="user_view_form">
<field name="model">res.user</field> <field name="model">res.user</field>
<field name="type">form</field> <field name="type" eval="None"/>
<field name="inherit" ref="res.user_view_form"/> <field name="inherit" ref="res.user_view_form"/>
<field name="name">user_form</field> <field name="name">user_form</field>
</record> </record>
<record model="ir.ui.view" id="user_view_form_preferences"> <record model="ir.ui.view" id="user_view_form_preferences">
<field name="model">res.user</field> <field name="model">res.user</field>
<field name="type">form</field> <field name="type" eval="None"/>
<field name="inherit" ref="res.user_view_form_preferences"/> <field name="inherit" ref="res.user_view_form_preferences"/>
<field name="name">user_form_preferences</field> <field name="name">user_form_preferences</field>
</record> </record>

View File

@ -11,7 +11,7 @@ copyright notices and license terms. -->
<xpath <xpath
expr="/form/notebook/page[@id=&quot;sale&quot;]/group/group/button[@name=&quot;process&quot;]" expr="/form/notebook/page[@id=&quot;sale&quot;]/group/group/button[@name=&quot;process&quot;]"
position="after"> position="after">
<button name="wizard_sale_payment" string="_Pay" <button name="wizard_sale_payment" string="Pay"
icon="tryton-go-next"/> icon="tryton-go-next"/>
</xpath> </xpath>
<xpath <xpath