Skip to content

Commit

Permalink
[MIG] purchase_order_general_discount: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
achulii committed Nov 22, 2024
1 parent 7542624 commit 2862d29
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions purchase_order_general_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
{
"name": "Purchase Order General Discount",
"summary": "General discount per purchase order",
"version": "16.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Purchases",
"website": "https://github.com/OCA/purchase-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["purchase_discount"],
"depends": ["purchase"],
"data": [
"views/purchase_order_view.xml",
"views/res_partner_view.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2022 Tecnativa - Pilar Vargas
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.tests import Form, TransactionCase, common
from odoo.tests import Form, TransactionCase


class TestPurchaseOrderLineInput(TransactionCase):
Expand All @@ -15,7 +15,7 @@ def setUpClass(cls):
cls.product = cls.env["product.product"].create(
{"name": "test_product", "type": "service"}
)
order_form = common.Form(cls.env["purchase.order"])
order_form = Form(cls.env["purchase.order"])
order_form.partner_id = cls.partner
with order_form.order_line.new() as line_form:
line_form.product_id = cls.product
Expand Down
5 changes: 1 addition & 4 deletions purchase_order_general_discount/views/res_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
ref="purchase.res_config_settings_view_form_purchase"
/>
<field name="arch" type="xml">
<xpath
expr="//div[@data-key='purchase']/div[hasclass('o_settings_container')][1]"
position="inside"
>
<xpath expr="//app[@name='purchase']/block" position="inside">
<div class="col-xs-12 col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="purchase_general_discount_field" />
Expand Down
4 changes: 2 additions & 2 deletions purchase_order_general_discount/views/res_partner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<!-- Copyright 2019 Tecnativa - David Vidal
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.ui.view" id="res_partner_form_view">
<record id="res_partner_form_view" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='purchase']" position="inside">
<field
invisible="is_company == False and parent_id != False"
name="purchase_general_discount"
attrs="{'invisible': [('is_company', '=', False), ('parent_id', '!=', False)]}"
/>
</xpath>
</field>
Expand Down

0 comments on commit 2862d29

Please sign in to comment.