diff --git a/MKS_Tradex_Backend_2/models/__pycache__/purchase_requisition.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/purchase_requisition.cpython-36.pyc index 50e4ab7..a5d3f33 100644 Binary files a/MKS_Tradex_Backend_2/models/__pycache__/purchase_requisition.cpython-36.pyc and b/MKS_Tradex_Backend_2/models/__pycache__/purchase_requisition.cpython-36.pyc differ diff --git a/MKS_Tradex_Backend_2/models/__pycache__/sale_order.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/sale_order.cpython-36.pyc index b00fd44..635be1e 100644 Binary files a/MKS_Tradex_Backend_2/models/__pycache__/sale_order.cpython-36.pyc and b/MKS_Tradex_Backend_2/models/__pycache__/sale_order.cpython-36.pyc differ diff --git a/bi_professional_reports_templates/__manifest__.py b/bi_professional_reports_templates/__manifest__.py index bb12d9c..935bc54 100644 --- a/bi_professional_reports_templates/__manifest__.py +++ b/bi_professional_reports_templates/__manifest__.py @@ -40,6 +40,7 @@ "purchase_report/modern_report_purchasequotation.xml", "purchase_report/odoo_standard_report_purchaseorder.xml", "purchase_report/odoo_standard_report_purchasequotation.xml", + "sale_report/classic_report_saleorder.xml", "sale_report/fency_report_saleorder.xml", diff --git a/bi_professional_reports_templates/delivery_report/fency_report_deliveryslip.xml b/bi_professional_reports_templates/delivery_report/fency_report_deliveryslip.xml index 1c8e8d0..8d87464 100644 --- a/bi_professional_reports_templates/delivery_report/fency_report_deliveryslip.xml +++ b/bi_professional_reports_templates/delivery_report/fency_report_deliveryslip.xml @@ -140,7 +140,6 @@ - @@ -198,7 +197,7 @@ - + diff --git a/intercompany_transaction_ept/models/account_invoice.py b/intercompany_transaction_ept/models/account_invoice.py index 76b3885..54c77ec 100644 --- a/intercompany_transaction_ept/models/account_invoice.py +++ b/intercompany_transaction_ept/models/account_invoice.py @@ -11,9 +11,9 @@ class AccountInvoice(models.Model): @api.model def create(self, vals): res = super(AccountInvoice, self).create(vals) - order_id = self.env['sale.order'].search([('name', '=', res.origin)]) + order_id = self.env['sale.order'].search([('name', '=', res.name)]) if not order_id: - order_id = self.env['purchase.order'].search([('name', '=', res.origin)]) + order_id = self.env['purchase.order'].search([('name', '=', res.name)]) if order_id and order_id.intercompany_transfer_id: res.intercompany_transfer_id = order_id.intercompany_transfer_id.id return res diff --git a/intercompany_transaction_ept/models/inter_company_transfer_ept.py b/intercompany_transaction_ept/models/inter_company_transfer_ept.py index 04ddfb1..392cce9 100644 --- a/intercompany_transaction_ept/models/inter_company_transfer_ept.py +++ b/intercompany_transaction_ept/models/inter_company_transfer_ept.py @@ -193,11 +193,11 @@ class InterCompanyTransfer(models.Model): if configuration_record.auto_confirm_orders: for order in sale_orders: order.write({'origin':record.name or ''}) - order.sudo(sale_user_id).action_confirm() + order.with_user(sale_user_id).action_confirm() for order in purchase_orders: order.write({'origin':record.name or ''}) - order.sudo(purchase_user_id).button_confirm() + order.with_user(purchase_user_id).button_confirm() @@ -207,11 +207,11 @@ class InterCompanyTransfer(models.Model): context = {"active_model": 'sale.order', "active_ids": [order.id], "active_id": order.id, 'open_invoices':True} if sale_journal: context.update({'default_journal_id':sale_journal.id}) - payment_id = sale_advance_paymentobj.sudo(sale_user_id).create({'advance_payment_method': 'delivered'}) - result = payment_id.with_context(context).sudo(sale_user_id).create_invoices() + payment_id = sale_advance_paymentobj.with_user(sale_user_id).create({'advance_payment_method': 'delivered'}) + result = payment_id.with_context(context).with_user(sale_user_id).create_invoices() result = result.get('res_id', False) - invoice_id = invoice_obj.sudo(sale_user_id).browse(result) - invoice_id.sudo(sale_user_id).write({'date_invoice':str(datetime.today()), 'intercompany_transfer_id':self.id}) + invoice_id = invoice_obj.with_user(sale_user_id).browse(result) + invoice_id.with_user(sale_user_id).write({'date_invoice':str(datetime.today()), 'intercompany_transfer_id':self.id}) vendor_bill_id = False @@ -221,26 +221,26 @@ class InterCompanyTransfer(models.Model): context.update({'default_journal_id':record.destination_company_id.purchase_journal.id}) invoice_dict = self.prepare_invoice_dict(record, purchase_partner_id, porder) - invoice_vals = invoice_obj.sudo(purchase_user_id).with_context(context).new(invoice_dict) + invoice_vals = invoice_obj.with_user(purchase_user_id).with_context(context).new(invoice_dict) invoice_vals.purchase_id = porder.id - invoice_vals.journal_id = invoice_vals.sudo(purchase_user_id)._default_journal() - invoice_vals.sudo(purchase_user_id).purchase_order_change() - invoice_vals.sudo(purchase_user_id)._onchange_partner_id() + invoice_vals.journal_id = invoice_vals.with_user(purchase_user_id)._default_journal() + invoice_vals.with_user(purchase_user_id).purchase_order_change() + invoice_vals.with_user(purchase_user_id)._onchange_partner_id() invoice_vals.date_invoice = str(datetime.today()) - invoice_vals.sudo(purchase_user_id)._onchange_payment_term_date_invoice() - invoice_vals.sudo(purchase_user_id)._onchange_origin() + invoice_vals.with_user(purchase_user_id)._onchange_payment_term_date_invoice() + invoice_vals.with_user(purchase_user_id)._onchange_origin() invoice_vals.currency_id = record.currency_id for line in invoice_vals.invoice_line_ids: line.quantity = line.purchase_line_id and line.purchase_line_id.product_qty or 0.0 - line.sudo(purchase_user_id)._compute_price() + line.with_user(purchase_user_id)._compute_price() vendor_bill_id = invoice_obj.sudo(purchase_user_id).with_context({'type':'in_invoice'}).create(invoice_vals._convert_to_write(invoice_vals._cache)) vendor_bill_id.intercompany_transfer_id = self.id if configuration_record.auto_validate_invoices: - invoice_id.sudo(sale_user_id).action_invoice_open() - vendor_bill_id.sudo(purchase_user_id).action_invoice_open() + invoice_id.with_user(sale_user_id).action_invoice_open() + vendor_bill_id.with_user(purchase_user_id).action_invoice_open() record.write({'state':'processed', 'processed_date':datetime.today(), 'message':'ICT processed successfully by %s' % (self.env.user.name)}) @@ -272,6 +272,7 @@ class InterCompanyTransfer(models.Model): def create_internal_transfer(self): + procurements = [] picking_obj = self.env['stock.picking'] procurementgroup_obj = self.env['procurement.group'] stocklocation_route_obj = self.env['stock.location.route'] @@ -282,13 +283,24 @@ class InterCompanyTransfer(models.Model): group_id = procurementgroup_obj.create({'name': self.name, 'partner_id': dest_wh.partner_id.id}) self.group_id = group_id.id route_ids = stocklocation_route_obj.search([('supplied_wh_id', '=', dest_wh.id), ('supplier_wh_id', '=', source_wh.id)]) + print('routeuuuuuuuuuuuuuuuuuuuuuuuuu',route_ids) if not route_ids: raise ValidationError(_("No routes are found. \n Please configure warehouse routes and set in products.")) if not self.intercompany_transferline_ids : raise ValidationError(_("No Products found. \n Please add products to transfer.")) for line in self.intercompany_transferline_ids: - procurementgroup_obj.run(line.product_id, line.quantity, line.product_id.uom_id, dest_wh.lot_stock_id, self.name, False, values={'warehouse_id':dest_wh, 'route_ids':route_ids and route_ids[0], 'group_id':self.group_id}) + print('comppppppppppppppppp',self.source_warehouse_id.company_id) + #values={'warehouse_id':dest_wh, 'route_ids':route_ids and route_ids[0], 'group_id':self.group_id,'product_id':line.product_id.id,'qty_rounded':line.quantity,'product_uom':line.product_id.uom_id,'location_id':dest_wh.lot_stock_id,'name':self.name,'company_id':self.source_company_id.id } + #procurementgroup_obj.run([values]) + values={'warehouse_id':dest_wh, 'route_ids':route_ids and route_ids[0], 'group_id':self.group_id} + #procurementgroup_obj.run(line.product_id, line.quantity, line.product_id.uom_id, dest_wh.lot_stock_id, self.name, False, values) + procurements.append(self.env['procurement.group'].Procurement( + line.product_id,line.quantity,line.product_id.uom_id,dest_wh.lot_stock_id,self.name,'abc',self.source_company_id,values + + )) + procurementgroup_obj.run(procurements) + print('lllllllllllllll',procurementgroup_obj) pickings = picking_obj.search([('group_id', '=', group_id.id)]) @@ -317,25 +329,25 @@ class InterCompanyTransfer(models.Model): source_warehouse_id = record.source_warehouse_id intercompany_user = source_company.sudo().intercompany_user_id.id or False partner_id = record.destination_company_id.sudo().partner_id - order_vals = sale_obj.sudo(intercompany_user).new({'partner_id':partner_id.id, 'warehouse_id':source_warehouse_id.id, 'pricelist_id':self.price_list_id.id}) - order_vals.sudo(intercompany_user).onchange_partner_id() + order_vals = sale_obj.with_user(intercompany_user).new({'partner_id':partner_id.id, 'warehouse_id':source_warehouse_id.id, 'pricelist_id':self.price_list_id.id}) + order_vals.with_user(intercompany_user).onchange_partner_id() order_vals.warehouse_id = source_warehouse_id.id - order_vals.sudo(intercompany_user)._onchange_company_id() - order_vals.fiscal_position_id = partner_id.sudo(intercompany_user).property_account_position_id.id + order_vals.with_user(intercompany_user)._onchange_company_id() + order_vals.fiscal_position_id = partner_id.with_user(intercompany_user).property_account_position_id.id order_vals.pricelist_id = self.price_list_id.id if record.crm_team_id: order_vals.team_id = record.crm_team_id.id - order_vals = order_vals.sudo(intercompany_user) - sale_order = sale_obj.sudo(intercompany_user).create(order_vals._convert_to_write(order_vals._cache)) + order_vals = order_vals.with_user(intercompany_user) + sale_order = sale_obj.with_user(intercompany_user).create(order_vals._convert_to_write(order_vals._cache)) so_lines_list = [] for line in record.intercompany_transferline_ids: - line_vals = saleline_obj.sudo(intercompany_user).new({'order_id':sale_order.id, 'product_id':line.product_id}) - line_vals.sudo(intercompany_user).product_id_change() - line_vals.sudo(intercompany_user).product_uom_qty = line.quantity + line_vals = saleline_obj.with_user(intercompany_user).new({'order_id':sale_order.id, 'product_id':line.product_id}) + line_vals.with_user(intercompany_user).product_id_change() + line_vals.with_user(intercompany_user).product_uom_qty = line.quantity line_vals.price_unit = line.price - line_vals = line_vals.sudo(intercompany_user)._convert_to_write(line_vals._cache) + line_vals = line_vals.with_user(intercompany_user)._convert_to_write(line_vals._cache) so_lines_list.append((0, 0, line_vals)) - sale_order.sudo(intercompany_user).write({'order_line':so_lines_list, 'intercompany_transfer_id':record.id}) + sale_order.with_user(intercompany_user).write({'order_line':so_lines_list, 'intercompany_transfer_id':record.id}) so_list.append(sale_order) return so_list @@ -349,22 +361,25 @@ class InterCompanyTransfer(models.Model): destination_company = record.destination_company_id intercompany_user = destination_company.sudo().intercompany_user_id.id or False print('intercompany_user$$$$$$$$$$$$$$$$$$$$$$',intercompany_user) - order_vals = purchase_obj.sudo(intercompany_user).new({'currency_id':self.currency_id.id, 'partner_id':record.source_warehouse_id.sudo().company_id.partner_id.id, 'company_id':destination_company.id}) - order_vals.sudo(intercompany_user).onchange_partner_id() + order_vals = purchase_obj.with_user(intercompany_user).new({'currency_id':self.currency_id.id, 'partner_id':record.source_warehouse_id.sudo().company_id.partner_id.id, 'company_id':destination_company.id}) + print('partner_idtest++++++++++++++++++', record.source_warehouse_id.sudo().company_id.partner_id.id) + order_vals.with_user(intercompany_user).onchange_partner_id() + print('order_valse+++++++++++++++', order_vals) order_vals.currency_id = self.currency_id.id order_vals.picking_type_id = self.destination_warehouse_id.sudo().in_type_id - purchase_order_id = purchase_obj.sudo(intercompany_user).create(order_vals.sudo(intercompany_user)._convert_to_write(order_vals._cache)) + purchase_order_id = purchase_obj.with_user(intercompany_user).create(order_vals.with_user(intercompany_user)._convert_to_write(order_vals._cache)) po_lines_list = [] for line in record.intercompany_transferline_ids: - line_vals = purchase_line_obj.sudo(intercompany_user).new({'order_id':purchase_order_id.id, 'product_id':line.product_id, 'currency_id':self.currency_id}) - line_vals.sudo(intercompany_user).onchange_product_id() + line_vals = purchase_line_obj.with_user(intercompany_user).new({'order_id':purchase_order_id.id, 'product_id':line.product_id, 'currency_id':self.currency_id}) + line_vals.with_user(intercompany_user).onchange_product_id() line_vals.product_qty = line.quantity line_vals.price_unit = line.price line_vals.product_uom = line.product_id.uom_id - line_vals = line_vals.sudo(intercompany_user)._convert_to_write(line_vals._cache) + line_vals = line_vals.with_user(intercompany_user)._convert_to_write(line_vals._cache) po_lines_list.append((0, 0, line_vals)) - purchase_order_id.sudo(intercompany_user).write({'order_line':po_lines_list, 'intercompany_transfer_id':record.id}) + purchase_order_id.with_user(intercompany_user).write({'order_line':po_lines_list, 'intercompany_transfer_id':record.id}) po_list.append(purchase_order_id) + print('po_list+++++++++++++++++++++',po_list,purchase_order_id) return po_list @@ -381,7 +396,7 @@ class InterCompanyTransfer(models.Model): def action_reverse_process(self): stockreturn_picking_obj = self.env['stock.return.picking'] - accountinvoice_refund_obj = self.env['account.invoice.refund'] + accountinvoice_refund_obj = self.env['account.move'] stock_move_obj = self.env['stock.move'] stock_picking_obj = self.env['stock.picking'] account_invoice_obj = self.env['account.move'] @@ -470,12 +485,12 @@ class InterCompanyTransfer(models.Model): for sorder in self.intercompany_transfer_id.saleorder_ids: for invoice in sorder.invoice_ids.filtered(lambda inv : inv.type == 'out_invoice'): customer_invoice_id = invoice.search([('refund_invoice_id', '=', invoice.id)], order='id desc' , limit=1) - default_inovoice_vals = accountinvoice_refund_obj.with_context({'active_id':invoice.id}).default_get(['filter_refund', 'description', 'date_invoice', 'date']) + default_inovoice_vals = accountinvoice_refund_obj.with_context({'active_id':invoice.id,'type':'out_refund'}).default_get(['filter_refund', 'description', 'date_invoice', 'date']) configuration_record = self.env.ref('intercompany_transaction_ept.intercompany_transaction_config_record') if configuration_record.filter_refund: default_inovoice_vals['filter_refund'] = configuration_record.filter_refund default_inovoice_vals.update({'description':'%s' % (configuration_record and configuration_record.description or ('for %s' % self.name))}) - customer_refund = accountinvoice_refund_obj.with_context({'active_id':invoice.id}).create(default_inovoice_vals) + customer_refund = accountinvoice_refund_obj.with_context({'active_id':invoice.id,'type':'out_refund'}).create(default_inovoice_vals) if customer_refund.with_context({'active_ids':invoice.id}).invoice_refund(): invoice_id = account_invoice_obj.search([('refund_invoice_id', '=', invoice.id)], order='id desc', limit=1) if invoice_id: @@ -490,12 +505,12 @@ class InterCompanyTransfer(models.Model): for porder in self.intercompany_transfer_id.purchaseorder_ids: for vendor_invoice in porder.invoice_ids.filtered(lambda inv : inv.type == 'in_invoice'): - default_inovoice_vals = accountinvoice_refund_obj.with_context({'active_id':vendor_invoice.id}).default_get(['filter_refund', 'description', 'date_invoice', 'date']) + default_inovoice_vals = accountinvoice_refund_obj.with_context({'active_id':vendor_invoice.id,'type':'in_refund'}).default_get(['filter_refund', 'description', 'date_invoice', 'date']) configuration_record = self.env.ref('intercompany_transaction_ept.intercompany_transaction_config_record') if configuration_record.filter_refund: default_inovoice_vals['filter_refund'] = configuration_record.filter_refund default_inovoice_vals.update({'description':'%s' % (configuration_record and configuration_record.description or ('for %s' % self.name))}) - vendor_refund = accountinvoice_refund_obj.with_context({'active_id':vendor_invoice.id}).create(default_inovoice_vals) + vendor_refund = accountinvoice_refund_obj.with_context({'active_id':vendor_invoice.id,'type':'in_refund'}).create(default_inovoice_vals) invoice_id = False if vendor_refund.with_context({'active_ids':vendor_invoice.id}).invoice_refund(): invoice_id = account_invoice_obj.search([('refund_invoice_id', '=', vendor_invoice.id)], order='id desc', limit=1) diff --git a/intercompany_transaction_ept/models/sale.py b/intercompany_transaction_ept/models/sale.py index f3f4f60..a628ab6 100644 --- a/intercompany_transaction_ept/models/sale.py +++ b/intercompany_transaction_ept/models/sale.py @@ -13,9 +13,9 @@ class SaleOrder(models.Model): def _prepare_invoice(self): if self.intercompany_transfer_id: - journal_id = self.env['account.invoice'].default_get(['journal_id'])['journal_id'] + journal_id = self.env['account.move'].default_get(['journal_id'])['journal_id'] vals = super(SaleOrder, self.with_context({'journal_id':journal_id}))._prepare_invoice() return vals else: vals = super(SaleOrder, self)._prepare_invoice() - return vals \ No newline at end of file + return vals diff --git a/inventory_groups/__pycache__/__init__.cpython-36.pyc b/inventory_groups/__pycache__/__init__.cpython-36.pyc index 2d1e9f8..fd2406d 100644 Binary files a/inventory_groups/__pycache__/__init__.cpython-36.pyc and b/inventory_groups/__pycache__/__init__.cpython-36.pyc differ diff --git a/inventory_groups/models/__pycache__/__init__.cpython-36.pyc b/inventory_groups/models/__pycache__/__init__.cpython-36.pyc index a0bfa60..0388fac 100644 Binary files a/inventory_groups/models/__pycache__/__init__.cpython-36.pyc and b/inventory_groups/models/__pycache__/__init__.cpython-36.pyc differ diff --git a/inventory_groups/models/__pycache__/groups.cpython-36.pyc b/inventory_groups/models/__pycache__/groups.cpython-36.pyc index 65b14bd..7ce6b2c 100644 Binary files a/inventory_groups/models/__pycache__/groups.cpython-36.pyc and b/inventory_groups/models/__pycache__/groups.cpython-36.pyc differ diff --git a/reports/__manifest__.py b/reports/__manifest__.py index e59a7aa..8b3cdf3 100644 --- a/reports/__manifest__.py +++ b/reports/__manifest__.py @@ -10,7 +10,7 @@ 'maintainer': '', 'website': "", 'depends': [ - 'base', 'account', 'bi_professional_reports_templates' + 'base','report', 'account', 'bi_professional_reports_templates' ], 'data': [ 'views/invoice_report.xml', diff --git a/reports/__pycache__/__init__.cpython-36.pyc b/reports/__pycache__/__init__.cpython-36.pyc index f181416..0a3dfea 100644 Binary files a/reports/__pycache__/__init__.cpython-36.pyc and b/reports/__pycache__/__init__.cpython-36.pyc differ diff --git a/reports/__pycache__/account.cpython-36.pyc b/reports/__pycache__/account.cpython-36.pyc index a73b701..3481b4b 100644 Binary files a/reports/__pycache__/account.cpython-36.pyc and b/reports/__pycache__/account.cpython-36.pyc differ diff --git a/reports/views/account_report.xml b/reports/views/account_report.xml index e4ae6f2..64533e8 100644 --- a/reports/views/account_report.xml +++ b/reports/views/account_report.xml @@ -10,7 +10,7 @@ 0 0 Portrait - 8 + 30 0 3 0 diff --git a/reports/views/report_payment_receipt.xml b/reports/views/report_payment_receipt.xml index 25b640f..b61baa2 100644 --- a/reports/views/report_payment_receipt.xml +++ b/reports/views/report_payment_receipt.xml @@ -4,7 +4,7 @@
-

Cash/Check Payment Voucher

+

Cash/Cheque Payment Voucher

diff --git a/tra_backend_Product/__pycache__/__init__.cpython-36.pyc b/tra_backend_Product/__pycache__/__init__.cpython-36.pyc index d217f10..a5e2afe 100644 Binary files a/tra_backend_Product/__pycache__/__init__.cpython-36.pyc and b/tra_backend_Product/__pycache__/__init__.cpython-36.pyc differ diff --git a/tra_backend_Product/models/__pycache__/__init__.cpython-36.pyc b/tra_backend_Product/models/__pycache__/__init__.cpython-36.pyc index 2de26b8..f15395d 100644 Binary files a/tra_backend_Product/models/__pycache__/__init__.cpython-36.pyc and b/tra_backend_Product/models/__pycache__/__init__.cpython-36.pyc differ diff --git a/tra_backend_Product/models/__pycache__/product.cpython-36.pyc b/tra_backend_Product/models/__pycache__/product.cpython-36.pyc index 50c0578..88f25fd 100644 Binary files a/tra_backend_Product/models/__pycache__/product.cpython-36.pyc and b/tra_backend_Product/models/__pycache__/product.cpython-36.pyc differ diff --git a/tra_backend_Product/models/account_move.py b/tra_backend_Product/models/account_move.py index 9caaa65..dde6d0e 100644 --- a/tra_backend_Product/models/account_move.py +++ b/tra_backend_Product/models/account_move.py @@ -10,7 +10,7 @@ class AccountMove(models.Model): # ==== Business fields ==== - overdue_by = fields.Float(string='Overdue By', index=True, compute='calculate_overdue_date') + overdue_by = fields.Float(string='Overdue By', index=True)#, compute='calculate_overdue_date') def calculate_overdue_date(self): diff --git a/tradex_rental/__pycache__/__init__.cpython-36.pyc b/tradex_rental/__pycache__/__init__.cpython-36.pyc index 1e23652..bac38b9 100644 Binary files a/tradex_rental/__pycache__/__init__.cpython-36.pyc and b/tradex_rental/__pycache__/__init__.cpython-36.pyc differ diff --git a/tradex_rental/models/__pycache__/__init__.cpython-36.pyc b/tradex_rental/models/__pycache__/__init__.cpython-36.pyc index 6ec8a3b..f8305fa 100644 Binary files a/tradex_rental/models/__pycache__/__init__.cpython-36.pyc and b/tradex_rental/models/__pycache__/__init__.cpython-36.pyc differ diff --git a/tradex_rental/models/__pycache__/job_contracts.cpython-36.pyc b/tradex_rental/models/__pycache__/job_contracts.cpython-36.pyc index b10f777..0605236 100644 Binary files a/tradex_rental/models/__pycache__/job_contracts.cpython-36.pyc and b/tradex_rental/models/__pycache__/job_contracts.cpython-36.pyc differ