Migrate to 5.8

This commit is contained in:
Sergio Morillo 2021-02-14 20:25:12 +01:00
parent 3df4ebea39
commit 3e788486cd
4 changed files with 12 additions and 46 deletions

View File

@ -1,6 +1,5 @@
# The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import ModelView
from trytond.pool import PoolMeta
from trytond.pyson import Eval, If
@ -16,5 +15,6 @@ class Sale(metaclass=PoolMeta):
cls._transitions.add(('confirmed', 'quotation'))
cls._buttons['quote']['invisible'] &= (Eval('state') != 'confirmed')
cls._buttons['quote'].update({
'icon': If(Eval('state') == 'confirmed', 'tryton-back', 'tryton-forward')
'icon': If(Eval('state') == 'confirmed',
'tryton-back', 'tryton-forward')
})

View File

@ -27,42 +27,6 @@ Create company::
>>> _ = create_company()
>>> company = get_company()
Reload the context::
>>> User = Model.get('res.user')
>>> Group = Model.get('res.group')
>>> config._context = User.get_preferences(True, config.context)
Create sale user::
>>> sale_user = User()
>>> sale_user.name = 'Sale'
>>> sale_user.login = 'sale'
>>> sale_user.main_company = company
>>> sale_group, = Group.find([('name', '=', 'Sales')])
>>> sale_user.groups.append(sale_group)
>>> sale_user.save()
Create stock user::
>>> stock_user = User()
>>> stock_user.name = 'Stock'
>>> stock_user.login = 'stock'
>>> stock_user.main_company = company
>>> stock_group, = Group.find([('name', '=', 'Stock')])
>>> stock_user.groups.append(stock_group)
>>> stock_user.save()
Create account user::
>>> account_user = User()
>>> account_user.name = 'Account'
>>> account_user.login = 'account'
>>> account_user.main_company = company
>>> account_group, = Group.find([('name', '=', 'Account')])
>>> account_user.groups.append(account_group)
>>> account_user.save()
Create fiscal year::
>>> fiscalyear = set_fiscalyear_invoice_sequences(
@ -78,10 +42,15 @@ Create chart of accounts::
>>> cash = accounts['cash']
>>> Journal = Model.get('account.journal')
>>> PaymentMethod = Model.get('account.invoice.payment.method')
>>> cash_journal, = Journal.find([('type', '=', 'cash')])
>>> cash_journal.credit_account = cash
>>> cash_journal.debit_account = cash
>>> cash_journal.save()
>>> payment_method = PaymentMethod()
>>> payment_method.name = 'Cash'
>>> payment_method.journal = cash_journal
>>> payment_method.credit_account = cash
>>> payment_method.debit_account = cash
>>> payment_method.save()
Create tax::
@ -120,7 +89,6 @@ Create product::
>>> template.name = 'product'
>>> template.default_uom = unit
>>> template.type = 'goods'
>>> template.purchasable = True
>>> template.salable = True
>>> template.list_price = Decimal('10')
>>> template.cost_price = Decimal('5')
@ -151,7 +119,6 @@ Create payment term::
Create an Inventory::
>>> config.user = stock_user.id
>>> Inventory = Model.get('stock.inventory')
>>> Location = Model.get('stock.location')
>>> storage, = Location.find([
@ -168,7 +135,6 @@ Create an Inventory::
Sale 5 products::
>>> config.user = sale_user.id
>>> Sale = Model.get('sale.sale')
>>> SaleLine = Model.get('sale.line')
>>> sale = Sale()

View File

@ -1,5 +1,5 @@
[tryton]
version=5.0.0
version=5.8.0
depends:
ir
res

View File

@ -3,8 +3,8 @@
this repository contains the full copyright notices and license terms. -->
<data>
<xpath
expr="/form/notebook/page[@id='sale']/group/group[@id='buttons']/button[@name='quote']"
expr="/form/group[@id='buttons']/button[@name='quote']"
position="replace_attributes">
<button name="quote" string="Quote"/>
<button name="quote"/>
</xpath>
</data>