diff --git a/odex25_purchase/khwalid_vendor/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/khwalid_vendor/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 4c909f070..000000000 Binary files a/odex25_purchase/khwalid_vendor/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/khwalid_vendor/models/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/khwalid_vendor/models/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index bf13a77bf..000000000 Binary files a/odex25_purchase/khwalid_vendor/models/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/khwalid_vendor/models/__pycache__/res_parnter.cpython-38.pyc b/odex25_purchase/khwalid_vendor/models/__pycache__/res_parnter.cpython-38.pyc deleted file mode 100644 index 95afdd379..000000000 Binary files a/odex25_purchase/khwalid_vendor/models/__pycache__/res_parnter.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/khwalid_vendor/wizard/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/khwalid_vendor/wizard/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index e88057b5b..000000000 Binary files a/odex25_purchase/khwalid_vendor/wizard/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/khwalid_vendor/wizard/__pycache__/messeage_wiz.cpython-38.pyc b/odex25_purchase/khwalid_vendor/wizard/__pycache__/messeage_wiz.cpython-38.pyc deleted file mode 100644 index e5109e7d0..000000000 Binary files a/odex25_purchase/khwalid_vendor/wizard/__pycache__/messeage_wiz.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/odex25_purchase/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/odex25_purchase/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index c6803dbd5..000000000 Binary files a/odex25_purchase/odex25_purchase/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/odex25_purchase_coc/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/odex25_purchase_coc/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 44e0237dc..000000000 Binary files a/odex25_purchase/odex25_purchase_coc/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/odex25_purchase_coc/controllers/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/odex25_purchase_coc/controllers/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 4ae514de1..000000000 Binary files a/odex25_purchase/odex25_purchase_coc/controllers/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/odex25_purchase_coc/controllers/__pycache__/controllers.cpython-38.pyc b/odex25_purchase/odex25_purchase_coc/controllers/__pycache__/controllers.cpython-38.pyc deleted file mode 100644 index 809212d8b..000000000 Binary files a/odex25_purchase/odex25_purchase_coc/controllers/__pycache__/controllers.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/odex25_purchase_coc/models/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/odex25_purchase_coc/models/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index d7e2dbdd2..000000000 Binary files a/odex25_purchase/odex25_purchase_coc/models/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/odex25_purchase_coc/models/__pycache__/models.cpython-38.pyc b/odex25_purchase/odex25_purchase_coc/models/__pycache__/models.cpython-38.pyc deleted file mode 100644 index cbcb825ce..000000000 Binary files a/odex25_purchase/odex25_purchase_coc/models/__pycache__/models.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_report/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_custom_report/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index b53f8e0d0..000000000 Binary files a/odex25_purchase/purchase_custom_report/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_report/wizard/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_custom_report/wizard/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 0a1280a25..000000000 Binary files a/odex25_purchase/purchase_custom_report/wizard/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_report/wizard/__pycache__/employee_purchase_report_wizard.cpython-38.pyc b/odex25_purchase/purchase_custom_report/wizard/__pycache__/employee_purchase_report_wizard.cpython-38.pyc deleted file mode 100644 index 5690087f8..000000000 Binary files a/odex25_purchase/purchase_custom_report/wizard/__pycache__/employee_purchase_report_wizard.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_committee_report.cpython-38.pyc b/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_committee_report.cpython-38.pyc deleted file mode 100644 index 7595e0af7..000000000 Binary files a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_committee_report.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_general_report_wizard.cpython-38.pyc b/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_general_report_wizard.cpython-38.pyc deleted file mode 100644 index c1fd2f744..000000000 Binary files a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_general_report_wizard.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_total_report_wizard.cpython-38.pyc b/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_total_report_wizard.cpython-38.pyc deleted file mode 100644 index 99182d998..000000000 Binary files a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_total_report_wizard.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_wizard.cpython-38.pyc b/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_wizard.cpython-38.pyc deleted file mode 100644 index 5421c5ef7..000000000 Binary files a/odex25_purchase/purchase_custom_report/wizard/__pycache__/purchase_wizard.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_stock/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_custom_stock/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 15e454d25..000000000 Binary files a/odex25_purchase/purchase_custom_stock/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_stock/models/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_custom_stock/models/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 1485485b4..000000000 Binary files a/odex25_purchase/purchase_custom_stock/models/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_stock/models/__pycache__/purchase_request.cpython-38.pyc b/odex25_purchase/purchase_custom_stock/models/__pycache__/purchase_request.cpython-38.pyc deleted file mode 100644 index 8f00aa993..000000000 Binary files a/odex25_purchase/purchase_custom_stock/models/__pycache__/purchase_request.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_stock/models/__pycache__/stock_warehouse.cpython-38.pyc b/odex25_purchase/purchase_custom_stock/models/__pycache__/stock_warehouse.cpython-38.pyc deleted file mode 100644 index 18692132a..000000000 Binary files a/odex25_purchase/purchase_custom_stock/models/__pycache__/stock_warehouse.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_stock/wizards/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_custom_stock/wizards/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index e3c741c11..000000000 Binary files a/odex25_purchase/purchase_custom_stock/wizards/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_custom_stock/wizards/__pycache__/picking_purchase_request.cpython-38.pyc b/odex25_purchase/purchase_custom_stock/wizards/__pycache__/picking_purchase_request.cpython-38.pyc deleted file mode 100644 index 4a4c2130a..000000000 Binary files a/odex25_purchase/purchase_custom_stock/wizards/__pycache__/picking_purchase_request.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 0f0e9e099..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 172bb480b..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/account_invoice.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/account_invoice.cpython-38.pyc deleted file mode 100644 index 49d98547c..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/account_invoice.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/account_payment.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/account_payment.cpython-38.pyc deleted file mode 100644 index 18626dd8e..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/account_payment.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/budget_confirmation.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/budget_confirmation.cpython-38.pyc deleted file mode 100644 index 402c9f293..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/budget_confirmation.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/mail_compose_message.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/mail_compose_message.cpython-38.pyc deleted file mode 100644 index 6cc1f6c4a..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/mail_compose_message.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_order.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_order.cpython-38.pyc deleted file mode 100644 index 7173c6b6c..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_order.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_request.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_request.cpython-38.pyc deleted file mode 100644 index cef0349c5..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_request.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_requisition_custom.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_requisition_custom.cpython-38.pyc deleted file mode 100644 index 3cfc42d48..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/purchase_requisition_custom.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/res_partner.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/res_partner.cpython-38.pyc deleted file mode 100644 index a95df6d8f..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/res_partner.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/__pycache__/res_settings.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/models/__pycache__/res_settings.cpython-38.pyc deleted file mode 100644 index e0dadb022..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/models/__pycache__/res_settings.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/models/purchase_order.py b/odex25_purchase/purchase_requisition_custom/models/purchase_order.py index eb32af36a..d454c8708 100644 --- a/odex25_purchase/purchase_requisition_custom/models/purchase_order.py +++ b/odex25_purchase/purchase_requisition_custom/models/purchase_order.py @@ -617,6 +617,8 @@ class PurchaseOrderCustom(models.Model): raise ValidationError(_("No analytic account for the project")) elif self.purchase_cost == 'product_line': pass # No analytic account assigned yet, it will be assigned later + else: + raise ValidationError(_("No analytic account for the purchase")) for order in self: for rec in order.order_line: @@ -626,30 +628,29 @@ class PurchaseOrderCustom(models.Model): if not analytic_account: raise ValidationError( _("Please put cost center to the product line") + ': {}'.format(rec.product_id.name)) - - if not ( - rec.product_id.property_account_expense_id.id and rec.product_id.property_account_expense_id.id - or rec.product_id.categ_id.property_account_expense_categ_id.id): + account_id = rec.product_id.property_account_expense_id and rec.product_id.property_account_expense_id or rec.product_id.categ_id.property_account_expense_categ_id + if not account_id: raise ValidationError( _("This product has no expense account") + ': {}'.format(rec.product_id.name)) - + budget_post = self.env['account.budget.post'].search([]).filtered(lambda x: account_id in x.account_ids) if analytic_account: budget_lines = self.env['crossovered.budget.lines'].search( [('analytic_account_id', '=', analytic_account.id), + ('general_budget_id','in',budget_post.ids), ('crossovered_budget_id.state', '=', 'done'), ('crossovered_budget_id.date_from', '<=', self.date_order), ('crossovered_budget_id.date_to', '>=', self.date_order)]) self.budget_id = budget_lines.mapped('crossovered_budget_id').id if budget_lines: - remain = abs(budget_lines[0].remain) + remain = abs(budget_lines.remain) amount += rec.price_subtotal new_balance = remain - amount confirmation_lines.append((0, 0, { 'amount': rec.price_subtotal, 'analytic_account_id': analytic_account.id, 'description': rec.product_id.name, - 'budget_line_id': budget_lines[0].id, + 'budget_line_id': budget_lines.id, 'remain': remain, 'new_balance': new_balance, 'account_id': rec.product_id.property_account_expense_id.id @@ -672,7 +673,7 @@ class PurchaseOrderCustom(models.Model): 'lines_ids': confirmation_lines, 'po_id': self.id } - budget_id = self.env['budget.confirmation'].create(data) + self.env['budget.confirmation'].create(data) self.write({'state': 'waiting'}) def budget_resend(self): diff --git a/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 1b651ad0e..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/cancel_purchase_request.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/cancel_purchase_request.cpython-38.pyc deleted file mode 100644 index 45cd3610f..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/cancel_purchase_request.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/convert_to_contract.cpython-38.pyc b/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/convert_to_contract.cpython-38.pyc deleted file mode 100644 index 6951542dc..000000000 Binary files a/odex25_purchase/purchase_requisition_custom/wizards/__pycache__/convert_to_contract.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/vendor_evaluation/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index c72133da3..000000000 Binary files a/odex25_purchase/vendor_evaluation/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/models/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/vendor_evaluation/models/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index c4ff2edf0..000000000 Binary files a/odex25_purchase/vendor_evaluation/models/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/models/__pycache__/account_invoice.cpython-38.pyc b/odex25_purchase/vendor_evaluation/models/__pycache__/account_invoice.cpython-38.pyc deleted file mode 100644 index 9a8e7af90..000000000 Binary files a/odex25_purchase/vendor_evaluation/models/__pycache__/account_invoice.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/models/__pycache__/evaluation_criteria.cpython-38.pyc b/odex25_purchase/vendor_evaluation/models/__pycache__/evaluation_criteria.cpython-38.pyc deleted file mode 100644 index 0888d6a70..000000000 Binary files a/odex25_purchase/vendor_evaluation/models/__pycache__/evaluation_criteria.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/models/__pycache__/purchase_order.cpython-38.pyc b/odex25_purchase/vendor_evaluation/models/__pycache__/purchase_order.cpython-38.pyc deleted file mode 100644 index 62a6b4fdd..000000000 Binary files a/odex25_purchase/vendor_evaluation/models/__pycache__/purchase_order.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/models/__pycache__/res_models.cpython-38.pyc b/odex25_purchase/vendor_evaluation/models/__pycache__/res_models.cpython-38.pyc deleted file mode 100644 index 1eab712f3..000000000 Binary files a/odex25_purchase/vendor_evaluation/models/__pycache__/res_models.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/models/__pycache__/stock.cpython-38.pyc b/odex25_purchase/vendor_evaluation/models/__pycache__/stock.cpython-38.pyc deleted file mode 100644 index 031d48534..000000000 Binary files a/odex25_purchase/vendor_evaluation/models/__pycache__/stock.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/models/__pycache__/vendor_evaluation.cpython-38.pyc b/odex25_purchase/vendor_evaluation/models/__pycache__/vendor_evaluation.cpython-38.pyc deleted file mode 100644 index 45b9ac1b7..000000000 Binary files a/odex25_purchase/vendor_evaluation/models/__pycache__/vendor_evaluation.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/wizard/__pycache__/__init__.cpython-38.pyc b/odex25_purchase/vendor_evaluation/wizard/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index f78e729fc..000000000 Binary files a/odex25_purchase/vendor_evaluation/wizard/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/odex25_purchase/vendor_evaluation/wizard/__pycache__/vendor_comparison.cpython-38.pyc b/odex25_purchase/vendor_evaluation/wizard/__pycache__/vendor_comparison.cpython-38.pyc deleted file mode 100644 index 60f3ab5fb..000000000 Binary files a/odex25_purchase/vendor_evaluation/wizard/__pycache__/vendor_comparison.cpython-38.pyc and /dev/null differ