Update to 4.8 [CI SKIP]
This commit is contained in:
parent
4aa4e36093
commit
8451a3bf33
|
@ -7,7 +7,8 @@ pipeline:
|
|||
image: ${IMAGE}
|
||||
environment:
|
||||
- CFLAGS=-O0
|
||||
- TOX_TESTENV_PASSENV=CFLAGS
|
||||
- DB_CACHE=/cache
|
||||
- TOX_TESTENV_PASSENV=CFLAGS DB_CACHE
|
||||
- POSTGRESQL_URI=postgresql://postgres@postgresql:5432/
|
||||
commands:
|
||||
- pip install tox
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .party import Party
|
||||
from .party import Party, PartyParty
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Party,
|
||||
PartyParty,
|
||||
module='account_invoice_party_invoice_to', type_='model')
|
||||
|
|
25
party.py
25
party.py
|
@ -1,16 +1,31 @@
|
|||
# The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.model import ModelSQL, fields
|
||||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.modules.company.model import CompanyValueMixin
|
||||
|
||||
__all__ = ['Party']
|
||||
__all__ = ['Party', 'PartyParty']
|
||||
|
||||
|
||||
class Party:
|
||||
__name__ = 'party.party'
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
customer_to_invoice = fields.Property(
|
||||
customer_to_invoice = fields.MultiValue(
|
||||
fields.Many2One('party.party', 'Customer to invoice'))
|
||||
supplier_to_invoice = fields.Property(
|
||||
supplier_to_invoice = fields.MultiValue(
|
||||
fields.Many2One('party.party', 'Supplier to invoice'))
|
||||
|
||||
@classmethod
|
||||
def multivalue_model(cls, field):
|
||||
pool = Pool()
|
||||
if field in {'customer_to_invoice', 'supplier_to_invoice'}:
|
||||
return pool.get('party.party.party')
|
||||
return super(Party, cls).multivalue_model(field)
|
||||
|
||||
|
||||
class PartyParty(ModelSQL, CompanyValueMixin):
|
||||
"Party Party"
|
||||
__name__ = 'party.party.party'
|
||||
customer_to_invoice = fields.Many2One('party.party', 'Customer to invoice')
|
||||
supplier_to_invoice = fields.Many2One('party.party', 'Supplier to invoice')
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -7,6 +7,7 @@ deps =
|
|||
{py27,py34,py35,py36}-postgresql: psycopg2 >= 2.5
|
||||
pypy-postgresql: psycopg2cffi >= 2.5
|
||||
mysql: MySQL-python
|
||||
sqlite: sqlitebck
|
||||
setenv =
|
||||
sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}
|
||||
postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=4.2.0
|
||||
version=4.8.0
|
||||
depends:
|
||||
account_invoice
|
||||
ir
|
||||
|
|
Loading…
Reference in New Issue