diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-31 23:52:35 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-31 23:52:35 +0700 |
| commit | 0f2445e3f7c74aa0ff81824de34d383691daa6a2 (patch) | |
| tree | d234fe2ab8dc838eb674cdb6e9f45bdf8a36247b | |
| parent | 011abd38d72b32347ed83713cf0397877f622d76 (diff) | |
<Miqdad> remove confirm order user validation
| -rw-r--r-- | fixco_custom/models/purchase_order.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fixco_custom/models/purchase_order.py b/fixco_custom/models/purchase_order.py index 01fa001..d9a760b 100644 --- a/fixco_custom/models/purchase_order.py +++ b/fixco_custom/models/purchase_order.py @@ -16,7 +16,7 @@ except ImportError: _logger = logging.getLogger(__name__) - + class PurchaseOrder(models.Model): _inherit = 'purchase.order' @@ -350,14 +350,15 @@ class PurchaseOrder(models.Model): def button_confirm(self): if self.env.user.id not in [12, 10, 2, 15]: self.check_buffer_stock() - if self.source == 'manual' and self.env.user.id not in [12, 10, 2, 15]: + # if self.source == 'manual' and self.env.user.id not in [12, 10, 2, 15]: + if self.source == 'manual': raise UserError(_("Anda tidak memiliki akses untuk melakukan konfirmasi PO manual")) res = super(PurchaseOrder, self).button_confirm() if self.partner_id.id == 270: self.action_create_order_altama() - + return res - + def check_buffer_stock(self): insufficient_products = [] @@ -421,11 +422,11 @@ class PurchaseOrder(models.Model): 'target': 'current', 'domain': [('id', 'in', journals.ids)], } - + @api.depends('order_line.price_total', 'biaya_lain_lain') def _amount_all(self): super(PurchaseOrder, self)._amount_all() - + for order in self: amount_total = order.amount_untaxed + order.amount_tax - order.biaya_lain_lain order.amount_total = order.currency_id.round(amount_total) @@ -433,4 +434,4 @@ class PurchaseOrder(models.Model): @api.depends('order_line.discount_amount') def _compute_amount_discount(self): for order in self: - order.amount_discount = sum(line.discount_amount for line in order.order_line)
\ No newline at end of file + order.amount_discount = sum(line.discount_amount for line in order.order_line) |
