diff --git a/purchase_ux/__manifest__.py b/purchase_ux/__manifest__.py index dc647575..1b2f6eda 100644 --- a/purchase_ux/__manifest__.py +++ b/purchase_ux/__manifest__.py @@ -41,6 +41,7 @@ "views/purchase_line_views.xml", "views/product_template_views.xml", "views/product_supplierinfo_views.xml", + "views/res_company_views.xml", ], "demo": [ "demo/purchase_order_demo.xml", diff --git a/purchase_ux/models/__init__.py b/purchase_ux/models/__init__.py index 58cc98e1..1497108f 100644 --- a/purchase_ux/models/__init__.py +++ b/purchase_ux/models/__init__.py @@ -2,7 +2,10 @@ # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## -from . import account_move -from . import purchase_order -from . import purchase_order_line -from . import product_template +from . import ( + account_move, + product_template, + purchase_order, + purchase_order_line, + res_company, +) diff --git a/purchase_ux/models/purchase_order.py b/purchase_ux/models/purchase_order.py index fe68dc35..3cc0f11b 100644 --- a/purchase_ux/models/purchase_order.py +++ b/purchase_ux/models/purchase_order.py @@ -10,6 +10,7 @@ class PurchaseOrder(models.Model): _inherit = "purchase.order" internal_notes = fields.Html() + skip_upload = fields.Boolean(related="company_id.skip_upload", string="Skip File Upload", readonly=True) force_invoiced_status = fields.Selection( [ diff --git a/purchase_ux/models/res_company.py b/purchase_ux/models/res_company.py new file mode 100644 index 00000000..c82f302e --- /dev/null +++ b/purchase_ux/models/res_company.py @@ -0,0 +1,14 @@ +############################################################################## +# For copyright and license notices, see __manifest__.py file in module root +# directory +############################################################################## +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + skip_upload = fields.Boolean( + string="Skip Bill File Upload", + help="When enabled, bills will be created directly without requiring file upload in purchase orders.", + ) diff --git a/purchase_ux/views/purchase_order_views.xml b/purchase_ux/views/purchase_order_views.xml index 33664304..0e490564 100644 --- a/purchase_ux/views/purchase_order_views.xml +++ b/purchase_ux/views/purchase_order_views.xml @@ -13,6 +13,11 @@ + + + + + @@ -35,6 +40,15 @@