19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import sale_coupon_share
from . import coupon_share

View file

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug.urls import url_encode
from odoo import fields, models, api, _
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
class SaleCouponShare(models.TransientModel):
class CouponShare(models.TransientModel):
_name = 'coupon.share'
_description = 'Create links that apply a coupon and redirect to a specific page'
@ -85,13 +84,12 @@ class SaleCouponShare(models.TransientModel):
raise UserError(_("Provide either a coupon or a program."))
return {
'name': _('Share') + f' {self.env["loyalty.program"]._program_items_name().get((program or coupon).program_type, "")}',
'name': _('Share %s', self.env["loyalty.program"]._program_items_name().get((program or coupon).program_type, "")),
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'coupon.share',
'target': 'new',
'context': {
'form_view_initial_mode': 'edit',
'default_program_id': program and program.id or coupon.program_id.id,
'default_coupon_id': coupon and coupon.id or None,
}

View file

@ -16,17 +16,17 @@
</div>
<field name="share_link" widget="CopyClipboardURL" no_label="1"/>
</group>
<group attrs="{'invisible': [('id', '!=', False)]}">
<group invisible="id">
<group>
<field name="website_id" groups="website.group_multi_website" widget="selection"
attrs="{'invisible': [('program_website_id', '!=', False)]}"/>
invisible="program_website_id"/>
<field name="redirect"/>
</group>
</group>
<footer>
<button string="Done" class="btn-primary" special="cancel" data-hotkey="z"/>
<button string="Done" class="btn-primary" special="cancel" data-hotkey="x"/>
<button string="Generate Short Link" class="btn-secondary" type="object" name="action_generate_short_link"
attrs="{'invisible': ['|', ('website_id', '=', False), ('id', '!=', False)]}" data-hotkey="g"/>
invisible="not website_id or id" data-hotkey="g"/>
</footer>
</form>
</field>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_inherit_website_sale_loyalty" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.website.sale.loyalty</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="website_sale.res_config_settings_view_form"/>
<field name="arch" type="xml">
<setting id="wsale_loyalty_setting" position="inside">
<div class="content-group">
<div class="mt8" invisible="not module_loyalty">
<button name="%(loyalty.loyalty_program_discount_loyalty_action)d"
type="action"
string="Loyalty Programs"
icon="oi-arrow-right"
class="btn-link"/>
</div>
</div>
</setting>
</field>
</record>
</odoo>