This commit is contained in:
2026-02-11 07:26:48 +01:00
parent 1eb86892de
commit e37cd4a1cc
7 changed files with 51 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ from trytond.exceptions import UserError
from trytond.modules.purchase_trade.purchase import (TRIGGERS)
from trytond.transaction import Transaction
from decimal import getcontext, Decimal, ROUND_HALF_UP
from sql import Table
class PartyExecution(ModelSQL,ModelView):
"Party Execution"
@@ -75,6 +76,17 @@ class Party(metaclass=PoolMeta):
if sp:
return round(((sp[0].cost / Decimal(100)) * Decimal(2.2046)),4)
def get_alf(self,name):
t = Table('alf')
cursor = Transaction().connection.cursor()
cursor.execute(*t.select(
t.ALF_CODE,
where=t.SHORT_NAME.ilike(f'%{name}%')
))
rows = cursor.fetchall()
if rows:
return int(rows[0][0])
@classmethod
def getPartyByName(cls, party, category=None):
party = party.upper()