Skip to content

Instantly share code, notes, and snippets.

View axlongines's full-sized avatar
🏠
Working from home

Axel [Vauxoo] axlongines

🏠
Working from home
View GitHub Profile
@axlongines
axlongines / gist:613335bc45b04efc68b4c2de6c192c92
Last active September 25, 2025 18:22
accion para cancelaer los pagos
payment_ids = [
71728,
71727,
70960,
70902,
70901,
70900,
70899,
70898,
70897,
@axlongines
axlongines / gist:9a9c373f2c3ae8598e10ab082beba566
Created August 1, 2025 19:46
accion de servidor para paid by credit note
account_moves_to_adjust = [
"RADMIN/2022/04/0060-FAG",
"RADMIN/2022/04/0010-FAG",
"RADMIN/2022/04/0011-FAG",
"RADMIN/2022/04/0012-FAG",
"RADMIN/2022/04/0013-FAG",
"RADMIN/2022/04/0014-FAG",
"RADMIN/2024/01/0002-FAG",
"RADMIN/2022/04/0015-FAG",
"RADMIN/2022/04/0017-FAG",
@axlongines
axlongines / gist:f09d27d04ead0b721d17b5737b48d1e0
Last active July 29, 2025 16:34
actualizar creditos con saldo actual 0
credit_obj = env["sbd.endorsement.credit"]
credit_to_change = {"2025-06-088810": 47165, "2025-06-088333": 139496.66,"ACAETUR-2023-11-0051-01":3770876.14}
for key, value in credit_to_change.items():
credit = credit_obj.search([("name", "=", key)])
credit.write({"actual_amount": value})
credit_obj = env["sbd.endorsement.credit"] # type: ignore
endorsement_obj = env["sbd.guarantee.out"] # type: ignore
# change the related document of the credit to endorsement
credit_to_change_document = credit_obj.search([("name", "=", "1199-9-2023-BAC")])
credit_to_change_document.write({"related_document": "endorsement"})
#
credits_endorsement = {
'2025-06-089417': '0129-10-2021-BAC',
<data>
<xpath expr="//form[1]/sheet[1]/group[1]/group[2]/div[@name='date_planned_div']/field[@name='date_planned']" position="attributes">
<attribute name="attrs">{}</attribute>
<attribute name="force_save">True</attribute>
</xpath>
<xpath expr="//div[@name='reminder']" position="after">
<field name="x_studio_shipping_date" string="Fecha de embarque"/>
<field name="x_studio_customs_delivery_address_id" string="Dirección de entrega" attrs="{&quot;invisible&quot;: [[&quot;incoterm_id&quot;,&quot;=&quot;,False]], &quot;readonly&quot;: [&quot;|&quot;,&quot;|&quot;,[&quot;state&quot;,&quot;=&quot;,&quot;purchase&quot;],[&quot;state&quot;,&quot;=&quot;,&quot;done&quot;],[&quot;state&quot;,&quot;=&quot;,&quot;cancel&quot;]], &quot;required&quot;: [[&quot;incoterm_id&quot;,&quot;!=&quot;,False]]}"/>
</xpath>
<xpath expr="//field[@name='fiscal_position_id']" position="after">
model : pms_reservation
period = fields.Integer(store=True,compute="_compute_period_reservation")
type_period = fields.Char(store=True,compute="_compute_period_reservation")
@api.depends("nights")
def _compute_period_reservation(self):
for res in self:
type_period = ""
if(res.nights < 7):
type_period = "day"