[FIX] all: fix some common typos

Sale Order --> Sales Order
Sale Report --> Sales Report
Sale Team -> Sales Team
Payment Term --> Payment Terms
This commit is contained in:
Kinjal Mehta
2016-12-22 13:29:38 +01:00
committed by Yannick Tivisse
parent 8309d4f4a8
commit b0185e15cc
88 changed files with 184 additions and 184 deletions
+4 -4
View File
@@ -18,16 +18,16 @@
</record>
<!--
Payment term
Payment terms
-->
<record id="account_payment_term_immediate" model="account.payment.term">
<field name="name">Immediate Payment</field>
<field name="note">Payment term: Immediate Payment</field>
<field name="note">Payment terms: Immediate Payment</field>
</record>
<record id="account_payment_term_15days" model="account.payment.term">
<field name="name">15 Days</field>
<field name="note">Payment term: 15 Days</field>
<field name="note">Payment terms: 15 Days</field>
<field name="line_ids" eval="[(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 15, 'option': 'day_after_invoice_date'})]"/>
</record>
@@ -38,7 +38,7 @@
<record id="account_payment_term_net" model="account.payment.term">
<field name="name">30 Net Days</field>
<field name="note">Payment term: 30 Net Days</field>
<field name="note">Payment terms: 30 Net Days</field>
<field name="line_ids" eval="[(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 30, 'option': 'day_after_invoice_date'})]"/>
</record>
+4 -4
View File
@@ -19,17 +19,17 @@
<record id="demo_coffee_machine_account" model="account.account.tag">
<field name="name">Demo Coffe Machine Account</field>
</record>
<!-- Payment Term -->
<!-- Payment Terms -->
<record id="account_payment_term" model="account.payment.term">
<field name="name">End of Following Month</field>
<field name="note">Payment term: End of Following Month</field>
<field name="note">Payment terms: End of Following Month</field>
<field name="line_ids" eval="[(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 0, 'option': 'last_day_following_month'})]"/>
</record>
<record id="account_payment_term_advance" model="account.payment.term">
<field name="name">30% Advance End of Following Month</field>
<field name="note">Payment term: 30% Advance End of Following Month</field>
<field name="note">Payment terms: 30% Advance End of Following Month</field>
<field name="line_ids" eval="[(0, 0, {'value': 'percent', 'value_amount': 30.0, 'sequence': 400, 'days': 0, 'option': 'day_after_invoice_date'}),
(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 0, 'option': 'last_day_following_month'})]"/>
</record>
@@ -38,7 +38,7 @@
<field name="groups_id" eval="[(4,ref('account.group_account_user'))]"/>
</record>
<!-- Add payment term on some demo partners -->
<!-- Add Payment terms on some demo partners -->
<record id="base.res_partner_2" model="res.partner">
<field name="property_payment_term_id" ref="account.account_payment_term_net"/>
</record>
+12 -12
View File
@@ -241,9 +241,9 @@ class AccountInvoice(models.Model):
date_due = fields.Date(string='Due Date',
readonly=True, states={'draft': [('readonly', False)]}, index=True, copy=False,
help="If you use payment terms, the due date will be computed automatically at the generation "
"of accounting entries. The payment term may compute several due dates, for example 50% "
"of accounting entries. The Payment terms may compute several due dates, for example 50% "
"now and 50% in one month, but if you want to force a due date, make sure that the payment "
"term is not set on the invoice. If you keep the payment term and the due date empty, it "
"term is not set on the invoice. If you keep the Payment terms and the due date empty, it "
"means direct payment.")
partner_id = fields.Many2one('res.partner', string='Partner', change_default=True,
required=True, readonly=True, states={'draft': [('readonly', False)]},
@@ -251,8 +251,8 @@ class AccountInvoice(models.Model):
payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms', oldname='payment_term',
readonly=True, states={'draft': [('readonly', False)]},
help="If you use payment terms, the due date will be computed automatically at the generation "
"of accounting entries. If you keep the payment term and the due date empty, it means direct payment. "
"The payment term may compute several due dates, for example 50% now, 50% in one month.")
"of accounting entries. If you keep the payment terms and the due date empty, it means direct payment. "
"The payment terms may compute several due dates, for example 50% now, 50% in one month.")
date = fields.Date(string='Accounting Date',
copy=False,
help="Keep empty to use the invoice date.",
@@ -522,7 +522,7 @@ class AccountInvoice(models.Model):
if not date_invoice:
date_invoice = fields.Date.context_today(self)
if not self.payment_term_id:
# When no payment term defined
# When no payment terms defined
self.date_due = self.date_due or self.date_invoice
else:
pterm = self.payment_term_id
@@ -1386,14 +1386,14 @@ class AccountInvoiceTax(models.Model):
class AccountPaymentTerm(models.Model):
_name = "account.payment.term"
_description = "Payment Term"
_description = "Payment Terms"
_order = "name"
def _default_line_ids(self):
return [(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 9, 'days': 0, 'option': 'day_after_invoice_date'})]
name = fields.Char(string='Payment Terms', translate=True, required=True)
active = fields.Boolean(default=True, help="If the active field is set to False, it will allow you to hide the payment term without removing it.")
active = fields.Boolean(default=True, help="If the active field is set to False, it will allow you to hide the payment terms without removing it.")
note = fields.Text(string='Description on the Invoice', translate=True)
line_ids = fields.One2many('account.payment.term.line', 'payment_id', string='Terms', copy=True, default=_default_line_ids)
company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.user.company_id)
@@ -1403,10 +1403,10 @@ class AccountPaymentTerm(models.Model):
def _check_lines(self):
payment_term_lines = self.line_ids.sorted()
if payment_term_lines and payment_term_lines[-1].value != 'balance':
raise ValidationError(_('A Payment Term should have its last line of type Balance.'))
raise ValidationError(_('A Payment Terms should have its last line of type Balance.'))
lines = self.line_ids.filtered(lambda r: r.value == 'balance')
if len(lines) > 1:
raise ValidationError(_('A Payment Term should have only one line of type Balance.'))
raise ValidationError(_('A Payment Terms should have only one line of type Balance.'))
@api.one
def compute(self, value, date_ref=False):
@@ -1448,7 +1448,7 @@ class AccountPaymentTerm(models.Model):
class AccountPaymentTermLine(models.Model):
_name = "account.payment.term.line"
_description = "Payment Term Line"
_description = "Payment Terms Line"
_order = "sequence, id"
value = fields.Selection([
@@ -1456,7 +1456,7 @@ class AccountPaymentTermLine(models.Model):
('percent', 'Percent'),
('fixed', 'Fixed Amount')
], string='Type', required=True, default='balance',
help="Select here the kind of valuation related to this payment term line.")
help="Select here the kind of valuation related to this payment terms line.")
value_amount = fields.Float(string='Value', digits=dp.get_precision('Payment Terms'), help="For percent enter a ratio between 0-100.")
days = fields.Integer(string='Number of Days', required=True, default=0)
option = fields.Selection([
@@ -1468,7 +1468,7 @@ class AccountPaymentTermLine(models.Model):
default='day_after_invoice_date', required=True, string='Options'
)
payment_id = fields.Many2one('account.payment.term', string='Payment Terms', required=True, index=True, ondelete='cascade')
sequence = fields.Integer(default=10, help="Gives the sequence order when displaying a list of payment term lines.")
sequence = fields.Integer(default=10, help="Gives the sequence order when displaying a list of payment terms lines.")
@api.one
@api.constrains('value', 'value_amount')
+1 -1
View File
@@ -402,7 +402,7 @@ class ResPartner(models.Model):
help="The fiscal position will determine taxes and accounts used for the partner.", oldname="property_account_position")
property_payment_term_id = fields.Many2one('account.payment.term', company_dependent=True,
string='Customer Payment Terms',
help="This payment term will be used instead of the default one for sale orders and customer invoices", oldname="property_payment_term")
help="This payment term will be used instead of the default one for sales orders and customer invoices", oldname="property_payment_term")
property_supplier_payment_term_id = fields.Many2one('account.payment.term', company_dependent=True,
string='Vendor Payment Terms',
help="This payment term will be used instead of the default one for purchase orders and vendor bills", oldname="property_supplier_payment_term")
+5 -5
View File
@@ -234,8 +234,8 @@
<field name="arch" type="xml">
<search string="Search Account Journal">
<field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Journal"/>
<filter domain="[('type', '=', 'sale')]" string="Sale"/>
<filter domain="[('type', '=', 'purchase')]" string="Purchase"/>
<filter domain="[('type', '=', 'sale')]" string="Sales"/>
<filter domain="[('type', '=', 'purchase')]" string="Purchases"/>
<filter domain="['|', ('type', '=', 'cash'), ('type', '=', 'bank')]" string="Liquidity"/>
<filter domain="[('type', 'not in', ['sale', 'purchase', 'cash', 'bank'])]" string="Miscellaneous"/>
<filter name="dashboard" string="Favorites" domain="[('show_on_dashboard', '=', True)]"/>
@@ -378,7 +378,7 @@
related to the day-to-day business.
</p><p>
A typical company may use one journal per payment method (cash,
bank accounts, checks), one purchase journal, one sale journal
bank accounts, checks), one purchase journal, one sales journal
and one for miscellaneous information.
</p>
</field>
@@ -1434,7 +1434,7 @@
</record>
<!-- Payment Terms -->
<!--Payment Terms -->
<record id="view_payment_term_line_tree" model="ir.ui.view">
<field name="name">account.payment.term.line.tree</field>
<field name="model">account.payment.term.line</field>
@@ -1498,7 +1498,7 @@
<field name="company_id" invisible="1"/>
</group>
<label for="note"/>
<field name="note" placeholder="Payment term explanation for the customer..."/>
<field name="note" placeholder="Payment terms explanation for the customer..."/>
<separator string="Terms"/>
<p class="text-muted">
The last line's computation type should be "Balance" to ensure that the whole amount will be allocated.
@@ -62,7 +62,7 @@
<p>
No activity yet on this account.
</p><p>
In Odoo, sale orders and projects are implemented using
In Odoo, sales orders and projects are implemented using
analytic accounts. You can track costs and revenues to analyse
your margins easily.
</p><p>
@@ -70,7 +70,7 @@
invoices, expenses or timesheets.
</p><p>
Revenues will be created automatically when you create customer
invoices. Customer invoices can be created based on sale orders
invoices. Customer invoices can be created based on sales orders
(fixed price invoices), on timesheets (based on the work done) or
on expenses (e.g. reinvoicing of travel costs).
</p>
@@ -252,7 +252,7 @@
<p>
No activity yet.
</p><p>
In Odoo, sale orders and projects are implemented using
In Odoo, sales orders and projects are implemented using
analytic accounts. You can track costs and revenues to analyse
your margins easily.
</p><p>
@@ -260,7 +260,7 @@
invoices, expenses or timesheets.
</p><p>
Revenues will be created automatically when you create customer
invoices. Customer invoices can be created based on sale orders
invoices. Customer invoices can be created based on sales orders
(fixed price invoices), on timesheets (based on the work done) or
on expenses (e.g. reinvoicing of travel costs).
</p>
+1 -1
View File
@@ -22,7 +22,7 @@
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subject">CRM application installed!</field>
<field name="body"><![CDATA[<p>From the top Sales menu you can track leads and opportunities, get accurate forecast on your sales pipeline, plan meetings, get realtime statistics and efficiently organize the communication with your prospects.</p>
<p>To manage quotations and sale orders, install the "Sales Management" application.</p>]]></field>
<p>To manage quotations and sales orders, install the "Sales Management" application.</p>]]></field>
</record>
<!-- opportunities' lost causes -->
+1 -1
View File
@@ -8,7 +8,7 @@ from odoo.modules.module import get_module_resource
class TestCRMLead(TestCrmCases):
def test_crm_lead_cancel(self):
# I set a new sale team giving access rights of salesman.
# I set a new sales team giving access rights of salesman.
team = self.env['crm.team'].sudo(self.crm_salemanager.id).create({'name': "Phone Marketing"})
lead = self.env.ref('crm.crm_case_1')
lead.sudo(self.crm_salemanager.id).write({'team_id': team.id})
+3 -3
View File
@@ -146,10 +146,10 @@ class DeliveryCarrier(models.Model):
# TODO define and handle exceptions that could be thrown by providers
def get_shipping_price_from_so(self, orders):
''' For every sale order, compute the price of the shipment
''' For every sales order, compute the price of the shipment
:param orders: A recordset of sale orders
:return list: A list of floats, containing the estimated price for the shipping of the sale order
:param orders: A recordset of sales orders
:return list: A list of floats, containing the estimated price for the shipping of the sales order
'''
self.ensure_one()
if hasattr(self, '%s_get_shipping_price_from_so' % self.delivery_type):
+2 -2
View File
@@ -44,7 +44,7 @@ class SaleOrder(models.Model):
@api.multi
def delivery_set(self):
# Remove delivery products from the sale order
# Remove delivery products from the sales order
self._delivery_unset()
for order in self:
@@ -82,7 +82,7 @@ class SaleOrder(models.Model):
if self.partner_id and self.fiscal_position_id:
taxes_ids = self.fiscal_position_id.map_tax(taxes, carrier.product_id, self.partner_id).ids
# Create the sale order line
# Create the sales order line
values = {
'order_id': self.id,
'name': carrier.name,
+8 -8
View File
@@ -30,7 +30,7 @@ class TestDeliveryCost(common.TransactionCase):
def test_00_delivery_cost(self):
# In order to test Carrier Cost
# Create sale order with Normal Delivery Charges
# Create sales order with Normal Delivery Charges
self.sale_normal_delivery_charges = self.SaleOrder.create({
'partner_id': self.partner_18.id,
@@ -46,7 +46,7 @@ class TestDeliveryCost(common.TransactionCase):
})],
'carrier_id': self.normal_delivery.id
})
# I add delivery cost in Sale order
# I add delivery cost in Sales order
self.a_sale = self.AccountAccount.create({
'code': 'X2020',
@@ -68,10 +68,10 @@ class TestDeliveryCost(common.TransactionCase):
'type': 'service'
})
# I add delivery cost in Sale order
# I add delivery cost in Sales order
self.sale_normal_delivery_charges.delivery_set()
# I check sale order after added delivery cost
# I check sales order after added delivery cost
line = self.SaleOrderLine.search([('order_id', '=', self.sale_normal_delivery_charges.id),
('product_id', '=', self.sale_normal_delivery_charges.carrier_id.product_id.id)])
@@ -80,11 +80,11 @@ class TestDeliveryCost(common.TransactionCase):
self.assertEqual(float_compare(line.price_subtotal, 10, precision_digits=2), 0,
"Delivey cost is not correspond.")
# I confirm the sale order
# I confirm the sales order
self.sale_normal_delivery_charges.action_confirm()
# Create one more sale order with Free Delivery Charges
# Create one more sales order with Free Delivery Charges
self.delivery_sale_order_cost = self.SaleOrder.create({
'partner_id': self.partner_4.id,
@@ -107,10 +107,10 @@ class TestDeliveryCost(common.TransactionCase):
'carrier_id': self.free_delivery.id
})
# I add free delivery cost in Sale order
# I add free delivery cost in Sales order
self.delivery_sale_order_cost.delivery_set()
# I check sale order after adding delivery cost
# I check sales order after adding delivery cost
line = self.SaleOrderLine.search([('order_id', '=', self.delivery_sale_order_cost.id),
('product_id', '=', self.delivery_sale_order_cost.carrier_id.product_id.id)])
@@ -40,7 +40,7 @@ class StockMoveInvoice(AccountingTestCase):
'carrier_id': self.normal_delivery.id
})
# I add delivery cost in Sale order
# I add delivery cost in Sales order
self.sale_prepaid.delivery_set()
# I confirm the SO.
+2 -2
View File
@@ -281,7 +281,7 @@ class EventRegistration(models.Model):
origin = fields.Char(
string='Source Document', readonly=True,
help="Reference of the document that created the registration, for example a sale order")
help="Reference of the document that created the registration, for example a sales order")
event_id = fields.Many2one(
'event.event', string='Event', required=True,
readonly=True, states={'draft': [('readonly', False)]})
@@ -329,7 +329,7 @@ class EventRegistration(models.Model):
@api.model
def _prepare_attendee_values(self, registration):
""" Method preparing the values to create new attendees based on a
sale order line. It takes some registration data (dict-based) that are
sales order line. It takes some registration data (dict-based) that are
optional values coming from an external input like a web page. This method
is meant to be inherited in various addons that sell events. """
partner_id = registration.pop('partner_id', self.env.user.partner_id)
+3 -3
View File
@@ -6,16 +6,16 @@
'category': 'Marketing',
'website': 'https://www.odoo.com/page/events',
'description': """
Creating registration with sale orders.
Creating registration with sales orders.
=======================================
This module allows you to automate and connect your registration creation with
your main sale flow and therefore, to enable the invoicing feature of registrations.
It defines a new kind of service products that offers you the possibility to
choose an event category associated with it. When you encode a sale order for
choose an event category associated with it. When you encode a sales order for
that product, you will be able to choose an existing event of that category and
when you confirm your sale order it will automatically create a registration for
when you confirm your sales order it will automatically create a registration for
this event.
""",
'depends': ['event', 'sale'],
+3 -3
View File
@@ -116,10 +116,10 @@ class EventRegistration(models.Model):
event_ticket_id = fields.Many2one('event.event.ticket', string='Event Ticket')
# in addition to origin generic fields, add real relational fields to correctly
# handle attendees linked to sale orders and their lines
# handle attendees linked to sales orders and their lines
# TDE FIXME: maybe add an onchange on sale_order_id + origin
sale_order_id = fields.Many2one('sale.order', string='Source Sale Order', ondelete='cascade')
sale_order_line_id = fields.Many2one('sale.order.line', string='Sale Order Line', ondelete='cascade')
sale_order_id = fields.Many2one('sale.order', string='Source Sales Order', ondelete='cascade')
sale_order_line_id = fields.Many2one('sale.order.line', string='Sales Order Line', ondelete='cascade')
@api.multi
@api.constrains('event_ticket_id', 'state')
+1 -1
View File
@@ -36,7 +36,7 @@ class SaleOrderLine(models.Model):
@api.multi
def _update_registrations(self, confirm=True, registration_data=None):
""" Create or update registrations linked to a sale order line. A sale
""" Create or update registrations linked to a sales order line. A sale
order line has a product_uom_qty attribute that will be the number of
registrations linked to this line. This method update existing registrations
and create new one for missing one. """
+3 -3
View File
@@ -25,21 +25,21 @@ class EventSaleTest(common.TransactionCase):
'date_begin': '2012-01-01 18:05:15'
})
# I create a sale order
# I create a sales order
self.sale_order = self.env['sale.order'].create({
'partner_id': self.env.ref('base.res_partner_2').id,
'note': 'Invoice after delivery',
'payment_term_id': self.env.ref('account.account_payment_term').id
})
# In the sale order I add some sale order lines. i choose event product
# In the sales order I add some sales order lines. i choose event product
self.env['sale.order.line'].create({
'product_id': product.id,
'price_unit': 190.50,
'product_uom': self.env.ref('product.product_uom_unit').id,
'product_uom_qty': 8.0,
'order_id': self.sale_order.id,
'name': 'sale order line',
'name': 'sales order line',
'event_id': event.id
})
@@ -6,7 +6,7 @@ from odoo import models, fields, api
class RegistrationEditor(models.TransientModel):
_name = "registration.editor"
sale_order_id = fields.Many2one('sale.order', 'Sale Order', required=True)
sale_order_id = fields.Many2one('sale.order', 'Sales Order', required=True)
event_registration_ids = fields.One2many('registration.editor.line', 'editor_id', string='Registrations to Edit')
@api.model
@@ -64,7 +64,7 @@ class RegistrationEditorLine(models.TransientModel):
_name = "registration.editor.line"
editor_id = fields.Many2one('registration.editor')
sale_order_line_id = fields.Many2one('sale.order.line', string='Sale Order Line')
sale_order_line_id = fields.Many2one('sale.order.line', string='Sales Order Line')
event_id = fields.Many2one('event.event', string='Event', required=True)
registration_id = fields.Many2one('event.registration', 'Original Registration')
event_ticket_id = fields.Many2one('event.event.ticket', string='Event Ticket')
+1 -1
View File
@@ -44,7 +44,7 @@ class TestCheckJournalEntry(TransactionCase):
# Assign it to the air ticket product
self.product.write({'property_account_expense_id': account_expense.id})
# Create Sale Journal
# Create Sales Journal
company = self.env.ref('base.main_company')
self.env['account.journal'].create({
'name': 'Purchase Journal - Test',
@@ -131,7 +131,7 @@ class SaleOrder(models.Model):
def _prepare_invoice(self):
"""
copy incoterm from sale order to invoice
copy incoterm from sales order to invoice
"""
invoice = super(SaleOrder, self)._prepare_invoice()
if self.incoterm:
+1 -1
View File
@@ -180,7 +180,7 @@ class XmlDeclaration(models.TransientModel):
#Check region
#If purchase, comes from purchase order, linked to a location,
#which is linked to the warehouse
#if sales, the sale order is linked to the warehouse
#if sales, the sales order is linked to the warehouse
#if sales, from a delivery order, linked to a location,
#which is linked to the warehouse
#If none found, get the company one.
@@ -37,7 +37,7 @@
<field name="message_type">notification</field>
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subject">Point of Sale application installed!</field>
<field name="body"><![CDATA[<p>Record sale orders, register payments, compute change to return, create invoices, and manage refunds through a specific web touch-screen interface.</p>
<field name="body"><![CDATA[<p>Record sales orders, register payments, compute change to return, create invoices, and manage refunds through a specific web touch-screen interface.</p>
<p>You can interface Odoo with retail hardware: barcode scanners, printers, cash registers, weighing machines, credit card payment terminals.</p>]]></field>
</record>
+2 -2
View File
@@ -63,7 +63,7 @@ class PosConfig(models.Model):
'stock.location', string='Stock Location',
domain=[('usage', '=', 'internal')], required=True, default=_get_default_location)
journal_id = fields.Many2one(
'account.journal', string='Sale Journal',
'account.journal', string='Sales Journal',
domain=[('type', '=', 'sale')],
help="Accounting journal used to post sales entries.",
default=_default_sale_journal)
@@ -169,7 +169,7 @@ class PosConfig(models.Model):
@api.constrains('company_id', 'journal_id')
def _check_company_journal(self):
if self.journal_id and self.journal_id.company_id.id != self.company_id.id:
raise UserError(_("The company of the sale journal is different than the one of point of sale"))
raise UserError(_("The company of the sales journal is different than the one of point of sale"))
@api.constrains('company_id', 'invoice_journal_id')
def _check_company_journal(self):
+1 -1
View File
@@ -361,7 +361,7 @@ class PosOrder(models.Model):
note = fields.Text(string='Internal Notes')
nb_print = fields.Integer(string='Number of Print', readonly=True, copy=False, default=0)
pos_reference = fields.Char(string='Receipt Ref', readonly=True, copy=False)
sale_journal = fields.Many2one('account.journal', related='session_id.config_id.journal_id', string='Sale Journal', store=True, readonly=True)
sale_journal = fields.Many2one('account.journal', related='session_id.config_id.journal_id', string='Sales Journal', store=True, readonly=True)
fiscal_position_id = fields.Many2one('account.fiscal.position', string='Fiscal Position', default=lambda self: self._default_session().config_id.default_fiscal_position_id)
@api.depends('statement_ids', 'lines.price_subtotal_incl', 'lines.discount')
+2 -2
View File
@@ -70,7 +70,7 @@ class PosSession(models.Model):
related='cash_register_id.total_entry_encoding',
string='Total Cash Transaction',
readonly=True,
help="Total of all paid sale orders")
help="Total of all paid sales orders")
cash_register_balance_end = fields.Monetary(
related='cash_register_id.balance_end',
digits=0,
@@ -149,7 +149,7 @@ class PosSession(models.Model):
default_journals = pos_config.with_context(ctx).default_get(['journal_id', 'invoice_journal_id'])
if (not default_journals.get('journal_id') or
not default_journals.get('invoice_journal_id')):
raise UserError(_("Unable to open the session. You have to assign a sale journal to your point of sale."))
raise UserError(_("Unable to open the session. You have to assign a sales journal to your point of sale."))
pos_config.with_context(ctx).sudo().write({
'journal_id': default_journals['journal_id'],
'invoice_journal_id': default_journals['invoice_journal_id']})
+1 -1
View File
@@ -9,7 +9,7 @@ class ResPartner(models.Model):
barcode = fields.Char(string='Barcode', help="BarCode", oldname='ean13')
pos_order_count = fields.Integer(
compute='_compute_pos_order',
help="The number of point of sale orders related to this customer",
help="The number of point of sales orders related to this customer",
groups="point_of_sale.group_pos_user",
)
+2 -2
View File
@@ -30,12 +30,12 @@ class TestUi(odoo.tests.HttpCase):
'value': 'account.account,' + str(account_receivable.id)})
# set the company currency to USD, otherwise it will assume
# euro's. this will cause issues as the sale journal is in
# euro's. this will cause issues as the sales journal is in
# USD, because of this all products would have a different
# price
main_company.currency_id = env.ref('base.USD')
test_sale_journal = journal_obj.create({'name': 'Sale Journal - Test',
test_sale_journal = journal_obj.create({'name': 'Sales Journal - Test',
'code': 'TSJ',
'type': 'sale',
'company_id': main_company.id})
@@ -19,7 +19,7 @@
</record>
<record id="sale_details_report" model="ir.actions.report.xml">
<field name="name">Sale Details</field>
<field name="name">Sales Details</field>
<field name="model">report.point_of_sale.details</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">point_of_sale.report_saledetails</field>
@@ -70,12 +70,12 @@
<record id="action_report_pos_details" model="ir.actions.act_window">
<field name="name">Sale Details</field>
<field name="name">Sales Details</field>
<field name="res_model">pos.details.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem id="menu_report_pos_order_all" name="Orders" action="action_report_pos_order_all" parent="menu_point_rep" sequence="3"/>
<menuitem id="menu_report_order_details" name="Sale Details" action="action_report_pos_details" parent="menu_point_rep" sequence="4"/>
<menuitem id="menu_report_order_details" name="Sales Details" action="action_report_pos_details" parent="menu_point_rep" sequence="4"/>
</odoo>
@@ -7,7 +7,7 @@
<div class="page">
<div class="text-center">
<h2>Sale Details</h2>
<h2>Sales Details</h2>
<strong><t t-esc="date_start"/> - <t t-esc="date_stop"/></strong>
</div>
+1 -1
View File
@@ -7,7 +7,7 @@ from odoo.exceptions import UserError
class PosDetails(models.TransientModel):
_name = 'pos.details.wizard'
_description = 'Open Sale Details Report'
_description = 'Open Sales Details Report'
start_date = fields.Datetime(required=True, default=fields.Datetime.now)
end_date = fields.Datetime(required=True, default=fields.Datetime.now)
+1 -1
View File
@@ -4,7 +4,7 @@
<field name="name">pos.details.wizard.form</field>
<field name="model">pos.details.wizard</field>
<field name="arch" type="xml">
<form string="Sale Details">
<form string="Sales Details">
<group>
<field name="start_date"/>
<field name="end_date"/>
+3 -3
View File
@@ -16,9 +16,9 @@ class ProcurementGroup(models.Model):
The procurement group class is used to group products together
when computing procurements. (tasks, physical products, ...)
The goal is that when you have one sale order of several products
The goal is that when you have one sales order of several products
and the products are pulled from the same or several location(s), to keep
having the moves grouped into pickings that represent the sale order.
having the moves grouped into pickings that represent the sales order.
Used in: sales order (to group delivery order lines like the so), pull/push
rules (to pack like the delivery order), on orderpoints (e.g. for wave picking
@@ -31,7 +31,7 @@ class ProcurementGroup(models.Model):
move from input will have a stock.picking with 2 grouped lines and the move
from stock will have 2 grouped lines also.
The name is usually the name of the original document (sale order) or a
The name is usually the name of the original document (sales order) or a
sequence computed if created manually.
'''
_name = 'procurement.group'
+2 -2
View File
@@ -7,9 +7,9 @@
'version': '1.0',
'category': 'Warehouse',
'description': """
This module will automatically reserve the picking from stock when a sale order is confirmed
This module will automatically reserve the picking from stock when a sales order is confirmed
============================================================================================
Upon confirmation of a sale order or when quantities are added,
Upon confirmation of a sales order or when quantities are added,
the picking that reserves from stock will be reserved if the
necessary quantities are available.
+1 -1
View File
@@ -37,7 +37,7 @@ class ProductTemplate(models.Model):
description_sale = fields.Text(
'Sale Description', translate=True,
help="A description of the Product that you want to communicate to your customers. "
"This description will be copied to every Sale Order, Delivery Order and Customer Invoice/Refund")
"This description will be copied to every Sales Order, Delivery Order and Customer Invoice/Refund")
type = fields.Selection([
('consu', _('Consumable')),
('service', _('Service'))], string='Product Type', default='consu', required=True,
@@ -172,7 +172,7 @@
Click to create a pricelist.
</p><p>
A price list contains rules to be evaluated in order to compute
the sales price of the products.
the sale price of the products.
</p><p>
Each rule include a set of applicability criteria (date range,
product category...) and a computation that easily helps to achieve
@@ -173,7 +173,7 @@
<td style="width:50%;">
<strong>CRM & Sales management:</strong>
<ul>
<li>From an opportunity to a sale order</li>
<li>From an opportunity to a sales order</li>
<li>Claims</li>
<li>Aftersale communication</li>
</ul>
@@ -351,7 +351,7 @@
<ul>
<li>Contracts</li>
<li>Invoicing methods
<li>Sale orders</li>
<li>Sales orders</li>
<li>Timesheets</li>
<li>Expenses</li>
</li>
@@ -430,7 +430,7 @@
</ul>
</td>
<td style="width:50%;">
From the sales perspective, you will have a manufacturing order generated based on a request coming from a customer without any manual operation. This integration of those two aplications allows you to perform the following flow in an automated way: Sale order –> Stock level verification –> Production of the missing units –> Receival in stock of the finished goods –> Delivery to the customer.
From the sales perspective, you will have a manufacturing order generated based on a request coming from a customer without any manual operation. This integration of those two aplications allows you to perform the following flow in an automated way: Sales order –> Stock level verification –> Production of the missing units –> Receival in stock of the finished goods –> Delivery to the customer.
</td>
</tr>
</table>
+1 -1
View File
@@ -47,7 +47,7 @@ Import Vendor Pricelists
Take smart purchase decisions using the best prices. Easily import vendor's
pricelists to make smarter purchase decisions based on promotions, prices
depending on quantities and special contract conditions. You can even base your
sales price depending on your vendor's prices.
sale price depending on your vendor's prices.
Control Products and Invoices
-----------------------------
+1 -1
View File
@@ -103,7 +103,7 @@ class PurchaseOrder(models.Model):
name = fields.Char('Order Reference', required=True, index=True, copy=False, default='New')
origin = fields.Char('Source Document', copy=False,\
help="Reference of the document that generated this purchase order "
"request (e.g. a sale order or an internal procurement request)")
"request (e.g. a sales order or an internal procurement request)")
partner_ref = fields.Char('Vendor Reference', copy=False,\
help="Reference of the sales order or bid sent by the vendor. "
"It's used to do the matching when you receive the "
@@ -45,7 +45,7 @@
<h3 class="oe_mt32 oe_mb8"><b>Get Supplier Price Lists and Product Availability</b></h3>
<h4>Make smart purchase decisions using the best prices</h4>
<p class="oe_mt16 oe_mb32 text-justify">
Easily import suppliers' price lists and references to make smarter purchase decisions based on promotions, quantities and special contract conditions. Keep track of a product availability in your supplier&apos;s stock and check your order status from within the app. You can even base your sales price on your supplier's prices.
Easily import suppliers' price lists and references to make smarter purchase decisions based on promotions, quantities and special contract conditions. Keep track of a product availability in your supplier&apos;s stock and check your order status from within the app. You can even base your sale price on your supplier's prices.
</p>
<img class="oe_picture oe_screenshot" src="purchase_product_form.png" style="margin-left: -1px;">
</div>
+1 -1
View File
@@ -32,7 +32,7 @@ You can choose flexible invoicing methods:
* *On Delivery Order*: Invoices are generated from picking (delivery)
* *Before Delivery*: A Draft invoice is created and must be paid before delivery
With this module you can personnalize the sale order and invoice report with
With this module you can personnalize the sales order and invoice report with
categories, subtotals or page-breaks.
The Dashboard for the Sales Manager will include
+1 -1
View File
@@ -57,7 +57,7 @@ from ${object.company_id.name}.
<!--Default Notification Email template for invoices-->
<record id="sale.mail_template_data_notification_email_sale_order" model="mail.template">
<field name="name">Sale Order Notification Email</field>
<field name="name">Sales Order Notification Email</field>
<field name="subject">${object.subject}</field>
<field name="model_id" ref="mail.model_mail_message"/>
<field name="auto_delete" eval="True"/>
+1 -1
View File
@@ -264,7 +264,7 @@
<field name="price_unit">12.50</field>
</record>
<!-- Confirm some Sale Orders-->
<!-- Confirm some Sales Orders-->
<function model="sale.order" name="action_confirm" eval="[[ref('sale_order_4')]]"/>
<function model="sale.order" name="action_confirm" eval="[[ref('sale_order_7')]]"/>
+2 -2
View File
@@ -66,7 +66,7 @@ class AccountInvoice(models.Model):
@api.multi
def order_lines_layouted(self):
"""
Returns this sale order lines ordered by sale_layout_category sequence. Used to render the report.
Returns this sales order lines ordered by sale_layout_category sequence. Used to render the report.
"""
self.ensure_one()
report_pages = [[]]
@@ -93,7 +93,7 @@ class AccountInvoiceLine(models.Model):
'sale.order.line',
'sale_order_line_invoice_rel',
'invoice_line_id', 'order_line_id',
string='Sale Order Lines', readonly=True, copy=False)
string='Sales Order Lines', readonly=True, copy=False)
layout_category_id = fields.Many2one('sale.layout_category', string='Section')
layout_category_sequence = fields.Integer(
related='layout_category_id.sequence',
+1 -1
View File
@@ -6,4 +6,4 @@ from odoo import fields, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
sale_line_id = fields.Many2one('sale.order.line', string='Sale Order Line')
sale_line_id = fields.Many2one('sale.order.line', string='Sales Order Line')
+1 -1
View File
@@ -11,7 +11,7 @@ class ProductTemplate(models.Model):
track_service = fields.Selection([('manual', 'Manually set quantities on order')], string='Track Service',
help="Manually set quantities on order: Invoice based on the manually entered quantity, without creating an analytic account.\n"
"Timesheets on contract: Invoice based on the tracked hours on the related timesheet.\n"
"Create a task and track hours: Create a task on the sale order validation and track the work hours.",
"Create a task and track hours: Create a task on the sales order validation and track the work hours.",
default='manual')
sale_line_warn = fields.Selection(WARNING_MESSAGE, 'Sales Order Line', help=WARNING_HELP, required=True, default="no-message")
sale_line_warn_msg = fields.Text('Message for Sales Order Line')
+8 -8
View File
@@ -114,7 +114,7 @@ class SaleOrder(models.Model):
validity_date = fields.Date(string='Expiration Date', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
help="Manually set the expiration date of your quotation (offer), or it will set the date automatically based on the template if online quotation is installed.")
create_date = fields.Datetime(string='Creation Date', readonly=True, index=True, help="Date on which sales order is created.")
confirmation_date = fields.Datetime(string='Confirmation Date', readonly=True, index=True, help="Date on which the sale order is confirmed.", oldname="date_confirm")
confirmation_date = fields.Datetime(string='Confirmation Date', readonly=True, index=True, help="Date on which the sales order is confirmed.", oldname="date_confirm")
user_id = fields.Many2one('res.users', string='Salesperson', index=True, track_visibility='onchange', default=lambda self: self.env.user)
partner_id = fields.Many2one('res.partner', string='Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, index=True, track_visibility='always')
partner_invoice_id = fields.Many2one('res.partner', string='Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Invoice address for current sales order.")
@@ -189,7 +189,7 @@ class SaleOrder(models.Model):
"""
Update the following fields when the partner is changed:
- Pricelist
- Payment term
- Payment terms
- Invoice address
- Delivery address
"""
@@ -281,7 +281,7 @@ class SaleOrder(models.Model):
self.ensure_one()
journal_id = self.env['account.invoice'].default_get(['journal_id'])['journal_id']
if not journal_id:
raise UserError(_('Please define an accounting sale journal for this company.'))
raise UserError(_('Please define an accounting sales journal for this company.'))
invoice_vals = {
'name': self.client_order_ref or '',
'origin': self.name,
@@ -740,13 +740,13 @@ class SaleOrderLine(models.Model):
order_partner_id = fields.Many2one(related='order_id.partner_id', store=True, string='Customer')
analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags')
is_downpayment = fields.Boolean(
string="Is a down payment", help="Down payments are made when creating invoices from a sale order."
" They are not copied when duplicating a sale order.")
string="Is a down payment", help="Down payments are made when creating invoices from a sales order."
" They are not copied when duplicating a sales order.")
state = fields.Selection([
('draft', 'Quotation'),
('sent', 'Quotation Sent'),
('sale', 'Sale Order'),
('sale', 'Sales Order'),
('done', 'Done'),
('cancel', 'Cancelled'),
], related='order_id.state', string='Order Status', readonly=True, copy=False, store=True, default='draft')
@@ -884,7 +884,7 @@ class SaleOrderLine(models.Model):
@api.multi
def unlink(self):
if self.filtered(lambda x: x.state in ('sale', 'done')):
raise UserError(_('You can not remove a sale order line.\nDiscard changes and try setting the quantity to 0.'))
raise UserError(_('You can not remove a sales order line.\nDiscard changes and try setting the quantity to 0.'))
return super(SaleOrderLine, self).unlink()
@api.multi
@@ -902,7 +902,7 @@ class SaleOrderLine(models.Model):
:parem float qty: total quentity of product
:param tuple price_and_rule: tuple(price, suitable_rule) coming from pricelist computation
:param obj uom: unit of measure of current order line
:param integer pricelist_id: pricelist id of sale order"""
:param integer pricelist_id: pricelist id of sales order"""
PricelistItem = self.env['product.pricelist.item']
field_name = 'lst_price'
currency_id = None
+2 -2
View File
@@ -36,7 +36,7 @@ class SaleOrderLine(models.Model):
class AccountAnalyticLine(models.Model):
_inherit = "account.analytic.line"
so_line = fields.Many2one('sale.order.line', string='Sale Order Line')
so_line = fields.Many2one('sale.order.line', string='Sales Order Line')
def _get_invoice_price(self, order):
if self.product_id.expense_policy == 'sales_price':
@@ -81,7 +81,7 @@ class AccountAnalyticLine(models.Model):
if not so_line and self.account_id and self.product_id and (self.product_id.expense_policy != 'no'):
order = self.env['sale.order'].search([('project_id', '=', self.account_id.id)], limit=1)
if order and order.state != 'sale':
raise UserError(_('The Sale Order %s linked to the Analytic Account must be validated before registering expenses.') % order.name)
raise UserError(_('The Sales Order %s linked to the Analytic Account must be validated before registering expenses.') % order.name)
order = self.env['sale.order'].search([('project_id', '=', self.account_id.id), ('state', '=', 'sale')], limit=1)
if not order:
+1 -1
View File
@@ -102,7 +102,7 @@ class SaleConfiguration(models.TransientModel):
auto_done_setting = fields.Selection([
(0, "Allow to edit sales order from the 'Sales Order' menu (not from the Quotation menu)"),
(1, "Never allow to modify a confirmed sales order")
], "Sale Order Modification")
], "Sales Order Modification")
module_sale_contract = fields.Boolean("Manage subscriptions and recurring invoicing")
module_website_sale_digital = fields.Boolean("Sell digital products - provide downloadable content on your customer portal")
+1 -1
View File
@@ -2,7 +2,7 @@
<odoo>
<record id="sale.group_sale_layout" model="res.groups">
<field name="name">Personalize sale order and invoice report</field>
<field name="name">Personalize sales order and invoice report</field>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
</record>
+2 -2
View File
@@ -8,7 +8,7 @@ from test_sale_common import TestSale
class TestSaleOrder(TestSale):
def test_sale_order(self):
""" Test the sale order flow (invoicing and quantity updates)
""" Test the sales order flow (invoicing and quantity updates)
- Invoice repeatedly while varrying delivered quantities and check that invoice are always what we expect
"""
# DBO TODO: validate invoice and register payments
@@ -66,7 +66,7 @@ class TestSaleOrder(TestSale):
self.assertTrue(so.invoice_status == 'invoiced', 'Sale: SO status after invoicing everything (including the upsel) should be "invoiced"')
def test_unlink_cancel(self):
""" Test deleting and cancelling sale orders depending on their state and on the user's rights """
""" Test deleting and cancelling sales orders depending on their state and on the user's rights """
so = self.env['sale.order'].create({
'partner_id': self.partner.id,
'partner_invoice_id': self.partner.id,
+6 -6
View File
@@ -33,8 +33,8 @@ class TestSale(TestMail):
product_template_id = self.env.ref('sale.advance_product_0').product_tmpl_id
product_template_id.write({'property_account_income_id': account_rev_id})
# Create Sale Journal
journal_obj.create({'name': 'Sale Journal - Test', 'code': 'STSJ', 'type': 'sale', 'company_id': company_id})
# Create Sales Journal
journal_obj.create({'name': 'Sales Journal - Test', 'code': 'STSJ', 'type': 'sale', 'company_id': company_id})
# In order to test, I create new user and applied Invoicing & Payments group.
user = self.env['res.users'].create({
@@ -43,21 +43,21 @@ class TestSale(TestMail):
'company_id': 1,
'groups_id': [(6, 0, [group_id])]})
assert user, "User will not created."
# I create partner for sale order.
# I create partner for sales order.
partner = partner_obj.create({
'name': 'Test Customer',
'email': 'testcustomer@test.com',
'property_account_receivable_id': account_recv_id,
})
# In order to test I create sale order and confirmed it.
# In order to test I create sales order and confirmed it.
order = self.env['sale.order'].create({
'partner_id': partner.id,
'partner_invoice_id': partner.id,
'partner_shipping_id': partner.id,
'date_order': datetime.today(),
'pricelist_id': self.env.ref('product.list0').id})
assert order, "Sale order will not created."
assert order, "Sales order will not created."
context = {"active_model": 'sale.order', "active_ids": [order.id], "active_id": order.id}
order.with_context(context).action_confirm()
# Now I create invoice.
@@ -67,7 +67,7 @@ class TestSale(TestMail):
'product_id': self.env.ref('sale.advance_product_0').id,
})
invoice = payment.with_context(context).create_invoices()
assert order.invoice_ids, "No any invoice is created for this sale order"
assert order.invoice_ids, "No any invoice is created for this sales order"
# Now I validate pay invoice wihth Test User(invoicing and payment).
for invoice in order.invoice_ids:
invoice.with_context(context).invoice_validate()
+2 -2
View File
@@ -11,9 +11,9 @@
<p class="oe_view_nocontent_create">
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation to a Sale Order, then create the Invoice and collect the Payment.
Your next actions should flow efficiently: confirm the Quotation to a Sales Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved from the Quotations list to the Sales Order list.
Note that once a Quotation becomes a Sales Order, it will be moved from the Quotations list to the Sales Order list.
</p>
</field>
</record>
+7 -7
View File
@@ -532,9 +532,9 @@
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation
to a Sale Order, then create the Invoice and collect the Payment.
to a Sales Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved
Note that once a Quotation becomes a Sales Order, it will be moved
from the Quotations list to the Sales Order list.
</p>
</field>
@@ -586,7 +586,7 @@
</record>
<record id="action_product_sale_list" model="ir.actions.act_window">
<field name="name">Sale Order Lines</field>
<field name="name">Sales Order Lines</field>
<field name="res_model">sale.order.line</field>
<field name="view_mode">tree</field>
<field name="context">{'search_default_product_id': [active_id], 'default_product_id': active_id}</field>
@@ -734,9 +734,9 @@
<p class="oe_view_nocontent_create">
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation to a Sale Order, then create the Invoice and collect the Payment.
Your next actions should flow efficiently: confirm the Quotation to a Sales Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved from the Quotations list to the Sales Order list.
Note that once a Quotation becomes a Sales Order, it will be moved from the Quotations list to the Sales Order list.
</p>
</field>
</record>
@@ -776,9 +776,9 @@
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation
to a Sale Order, then create the Invoice and collect the Payment.
to a Sales Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved
Note that once a Quotation becomes a Sales Order, it will be moved
from the Quotations list to the Sales Order list.
</p>
</field>
+1 -1
View File
@@ -10,7 +10,7 @@ This module adds a shortcut on one or several opportunity cases in the CRM.
===========================================================================
This shortcut allows you to generate a sales order based on the selected case.
If different cases are open (a list), it generates one sale order by case.
If different cases are open (a list), it generates one sales order by case.
The case is then closed and linked to the generated sales order.
We suggest you to install this module, if you installed both the sale and the crm
+1 -1
View File
@@ -7,4 +7,4 @@ from odoo import fields, models
class ResUsers(models.Model):
_inherit = 'res.users'
target_sales_invoiced = fields.Integer('Invoiced in Sale Orders Target')
target_sales_invoiced = fields.Integer('Invoiced in Sales Orders Target')
+1 -1
View File
@@ -5,7 +5,7 @@
'name': 'Sales Expense',
'version': '1.0',
'category': 'Sales',
'summary': 'Quotation, Sale Orders, Delivery & Invoicing Control',
'summary': 'Quotation, Sales Orders, Delivery & Invoicing Control',
'description': """
Module used for demo data
=========================
@@ -52,7 +52,7 @@ class TestSaleExpense(TestSale):
self.assertEqual((sol.price_unit, sol.qty_delivered), (621.54, 1.0), 'Sale Expense: error when invoicing an expense at cost')
self.assertEqual(so.amount_total, init_price, 'Sale Expense: price of so not updated after adding expense')
# create some expense and validate it (expense at sales price)
# create some expense and validate it (expense at sale price)
init_price = so.amount_total
prod_exp_2 = self.env.ref('hr_expense.car_travel')
# Submit to Manager
+3 -3
View File
@@ -19,7 +19,7 @@ class TestSaleMargin(common.TransactionCase):
def test_sale_margin(self):
""" Test the sale_margin module in Odoo. """
# Create a sale order for product Graphics Card.
# Create a sales order for product Graphics Card.
sale_order_so11 = self.SaleOrder.create({
'date_order': datetime.today(),
'name': 'Test_SO011',
@@ -35,7 +35,7 @@ class TestSaleMargin(common.TransactionCase):
'partner_invoice_id': self.partner_invoice_address_id,
'partner_shipping_id': self.partner_invoice_address_id,
'pricelist_id': self.pricelist_id})
# Confirm the sale order.
# Confirm the sales order.
sale_order_so11.action_confirm()
# Verify that margin field gets bind with the value.
self.assertEqual(sale_order_so11.margin, 3000.00, "Sale order margin should be 3000.00")
self.assertEqual(sale_order_so11.margin, 3000.00, "Sales order margin should be 3000.00")
+3 -3
View File
@@ -36,9 +36,9 @@ class TestMoveExplode(common.TransactionCase):
def test_00_sale_move_explode(self):
"""check that when creating a sale order with a product that has a phantom BoM, move explode into content of the
"""check that when creating a sales order with a product that has a phantom BoM, move explode into content of the
BoM"""
#create sale order with one sale order line containing product with a phantom bom
#create sales order with one sales order line containing product with a phantom bom
so_vals = {
'partner_id': self.partner.id,
'partner_invoice_id': self.partner.id,
@@ -47,7 +47,7 @@ class TestMoveExplode(common.TransactionCase):
'pricelist_id': self.pricelist.id,
}
self.so = self.SaleOrder.create(so_vals)
#confirm sale order
#confirm sales order
self.so.action_confirm()
#get all move associated to that sale_order
move_ids = self.so.picking_ids.mapped('move_lines').ids
+3 -3
View File
@@ -111,7 +111,7 @@ class TestSaleMrpFlow(common.TransactionCase):
create_bom_lines(bom_d.id, product_c.id, 1, self.uom_kg.id, 'make_to_stock')
# ----------------------------------------
# Create sale order of 10 Dozen product A.
# Create sales order of 10 Dozen product A.
# ----------------------------------------
order = self.SaleOrder.create({
@@ -128,11 +128,11 @@ class TestSaleMrpFlow(common.TransactionCase):
'product_uom_qty': 10,
'product_uom': self.uom_dozen.id
})
self.assertTrue(order, "Sale order not created.")
self.assertTrue(order, "Sales order not created.")
order.action_confirm()
# ===============================================================================
# Sale order of 10 Dozen product A should create production order
# Sales order of 10 Dozen product A should create production order
# like ..
# ===============================================================================
# Product A 10 Dozen.
+1 -1
View File
@@ -6,7 +6,7 @@ from odoo import api, fields, models, _
class SaleOrder(models.Model):
"""Add several date fields to Sale Orders, computed or user-entered"""
"""Add several date fields to Sales Orders, computed or user-entered"""
_inherit = 'sale.order'
commitment_date = fields.Datetime(compute='_compute_commitment_date', string='Commitment Date', store=True,
@@ -9,10 +9,10 @@ class TestSaleOrderDates(common.TransactionCase):
def test_sale_order_requested_date(self):
# In order to test the Requested Date feature in Sale Orders in Odoo,
# I copy a demo Sale Order with Requested Date on 2010-07-12
# In order to test the Requested Date feature in Sales Orders in Odoo,
# I copy a demo Sales Order with Requested Date on 2010-07-12
new_order = self.env.ref('sale.sale_order_6').copy({'requested_date': '2010-07-12'})
# I confirm the Sale Order.
# I confirm the Sales Order.
new_order.action_confirm()
# I verify that the Procurements and Stock Moves have been generated with the correct date
security_delay = timedelta(days=new_order.company_id.security_lead)
+1 -1
View File
@@ -5,7 +5,7 @@
'name': 'Sale Service Rating',
'category': 'Hidden',
'description': """
This module allows a customer to give rating on task which are created from sale order.
This module allows a customer to give rating on task which are created from sales order.
""",
'depends': [
'rating_project',
+1 -1
View File
@@ -5,7 +5,7 @@
'name': 'Sales and Warehouse Management',
'version': '1.0',
'category': 'Hidden',
'summary': 'Quotation, Sale Orders, Delivery & Invoicing Control',
'summary': 'Quotation, Sales Orders, Delivery & Invoicing Control',
'description': """
Manage sales quotations and orders
==================================
+1 -1
View File
@@ -176,7 +176,7 @@ class SaleOrderLine(models.Model):
@api.multi
def _get_delivered_qty(self):
"""Computes the delivered quantity on sale order lines, based on done stock moves related to its procurements
"""Computes the delivered quantity on sales order lines, based on done stock moves related to its procurements
"""
self.ensure_one()
super(SaleOrderLine, self)._get_delivered_qty()
+4 -4
View File
@@ -15,13 +15,13 @@ class StockMove(models.Model):
to_refund_so = fields.Boolean(
"To Refund in SO", default=False,
help='Trigger a decrease of the delivered quantity in the associated Sale Order')
help='Trigger a decrease of the delivered quantity in the associated Sales Order')
@api.multi
def action_done(self):
result = super(StockMove, self).action_done()
# Update delivered quantities on sale order lines
# Update delivered quantities on sales order lines
sale_order_lines = self.filtered(lambda move: move.procurement_id.sale_line_id and move.product_id.expense_policy == 'no').mapped('procurement_id.sale_line_id')
for line in sale_order_lines:
line.qty_delivered = line._get_delivered_qty()
@@ -44,7 +44,7 @@ class StockMove(models.Model):
class StockPicking(models.Model):
_inherit = 'stock.picking'
sale_id = fields.Many2one('sale.order', "Sale Order", compute='_compute_sale_id', search='_search_sale_id')
sale_id = fields.Many2one('sale.order', "Sales Order", compute='_compute_sale_id', search='_search_sale_id')
@api.one
@api.depends('move_lines.procurement_id.sale_line_id.order_id')
@@ -91,4 +91,4 @@ class StockReturnPicking(models.TransientModel):
class StockReturnPickingLine(models.TransientModel):
_inherit = "stock.return.picking.line"
to_refund_so = fields.Boolean(string="To Refund", help='Trigger a decrease of the delivered quantity in the associated Sale Order')
to_refund_so = fields.Boolean(string="To Refund", help='Trigger a decrease of the delivered quantity in the associated Sales Order')
+1 -1
View File
@@ -18,7 +18,7 @@
<field name="model">stock.location.route</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='warehouse_ids']" position="after">
<br/><field name="sale_selectable" string="Sale Order Lines"/>
<br/><field name="sale_selectable" string="Sales Order Lines"/>
</xpath>
</field>
</record>
+1 -1
View File
@@ -12,7 +12,7 @@ class ProductTemplate(models.Model):
('task', 'Create a task and track hours')])
project_id = fields.Many2one(
'project.project', 'Project', company_dependent=True,
help='Create a task under this project on sale order validation. This setting must be set for each company.')
help='Create a task under this project on sales order validation. This setting must be set for each company.')
@api.onchange('type')
def _onchange_type(self):
+1 -1
View File
@@ -14,7 +14,7 @@ class ProjectTask(models.Model):
@api.multi
def unlink(self):
if any(task.sale_line_id for task in self):
raise ValidationError(_('You cannot delete a task related to a Sale Order. You can only archive this task.'))
raise ValidationError(_('You cannot delete a task related to a Sales Order. You can only archive this task.'))
return super(ProjectTask, self).unlink()
@api.multi
+1 -1
View File
@@ -52,7 +52,7 @@ class SaleOrder(models.Model):
if line.product_id.track_service == 'timesheet':
count += 1
if count > 1:
raise ValidationError(_("You can use only one product on timesheet within the same sale order. You should split your order to include only one contract based on time and material."))
raise ValidationError(_("You can use only one product on timesheet within the same sales order. You should split your order to include only one contract based on time and material."))
return {}
@api.multi
+1 -1
View File
@@ -9,4 +9,4 @@ class ResPartner(models.Model):
team_id = fields.Many2one(
'crm.team', 'Sales Team',
help='If set, sale team used notably for sales and assignations related to this partner')
help='If set, sales team used notably for sales and assignations related to this partner')
+2 -2
View File
@@ -286,9 +286,9 @@
<div class="panel-body">
<div><span class="label label-default text-center odoo_purple"><a t-att-href="prepare_backend_url('sale.action_quotations')"> Create a Quotation</a></span><div> for a customer and add products</div></div>
<span class="fa fa-angle-down fa-2x"></span>
<div><span class="label label-default text-center odoo_purple">Confirm Sale</span><div>The quotation becomes a Sale Order and a Transfer Order is created</div></div>
<div><span class="label label-default text-center odoo_purple">Confirm Sale</span><div>The quotation becomes a Sales Order and a Transfer Order is created</div></div>
<span class="fa fa-angle-down fa-2x"></span>
<div><span class="label label-default text-center odoo_purple">Click on <span class="fa fa-truck"/> Delivery</span><div> on the sale order form to see Transfer Order</div></div>
<div><span class="label label-default text-center odoo_purple">Click on <span class="fa fa-truck"/> Delivery</span><div> on the sales order form to see Transfer Order</div></div>
</div>
</div>
</div>
+2 -2
View File
@@ -25,11 +25,11 @@ class StockSettings(models.TransientModel):
'res.company', 'Company',
default=lambda self: self.env.user.company_id, required=True)
module_procurement_jit = fields.Selection([
(1, 'Reserve products immediately after the sale order confirmation'),
(1, 'Reserve products immediately after the sales order confirmation'),
(0, 'Reserve products manually or based on automatic scheduler')
], "Procurements",
help="""Allows you to automatically reserve the available
products when confirming a sale order.
products when confirming a sales order.
This installs the module procurement_jit.""")
module_product_expiry = fields.Selection([
(0, 'Do not use Expiration Date on serial numbers'),
@@ -40,7 +40,7 @@ class website_account(website_account):
return response
#
# Quotations and Sale Orders
# Quotations and Sales Orders
#
@http.route(['/my/quotes', '/my/quotes/page/<int:page>'], type='http', auth="user", website=True)
@@ -70,7 +70,7 @@
</record>
<!-- Confirm some Sale Orders-->
<!-- Confirm some Sales Orders-->
<function model="sale.order" name="action_confirm" eval="[[ref('sale_order_2')]]"/>
</odoo>
+3 -3
View File
@@ -9,8 +9,8 @@ _logger = logging.getLogger(__name__)
class PaymentTransaction(models.Model):
_inherit = 'payment.transaction'
# link with the sale order
sale_order_id = fields.Many2one('sale.order', string='Sale Order')
# link with the sales order
sale_order_id = fields.Many2one('sale.order', string='Sales Order')
def _generate_and_pay_invoice(self, tx, acquirer_name):
tx.sale_order_id._force_lines_to_invoice_policy_order()
@@ -36,7 +36,7 @@ class PaymentTransaction(models.Model):
@api.model
def form_feedback(self, data, acquirer_name):
""" Override to confirm the sale order, if defined, and if the transaction
""" Override to confirm the sales order, if defined, and if the transaction
is done. """
tx = None
res = super(PaymentTransaction, self).form_feedback(data, acquirer_name)
@@ -12,7 +12,7 @@ class SaleOrder(models.Model):
def get_access_action(self):
""" Instead of the classic form view, redirect to the online quote for
portal users that have access to a confirmed order. """
# TDE note: read access on sale order to portal users granted to followed sale orders
# TDE note: read access on sales order to portal users granted to followed sales orders
self.ensure_one()
if self.state == 'cancel' or (self.state == 'draft' and not self.env.context.get('mark_so_as_sent')):
return super(SaleOrder, self).get_access_action()
@@ -121,7 +121,7 @@
<div class="table-responsive"><table class="table table-hover o_my_status_table">
<thead>
<tr class="active">
<th>Sale Order #</th>
<th>Sales Order #</th>
<th>Order Date</th>
<th></th>
<th>Total</th>
@@ -484,7 +484,7 @@
<li class="list-group-item">Convert Lead to Opportunity &amp; Customer management</li>
<li class="list-group-item">Schedule Phone Calls and Meetings</li>
<li class="list-group-item">Negotiation and Quotation Revisions</li>
<li class="list-group-item">Generate Sale Order &amp; direct mail to customer</li>
<li class="list-group-item">Generate Sales Order &amp; direct mail to customer</li>
</ul>
</div>
</div>
+1 -1
View File
@@ -195,7 +195,7 @@ class SaleOrderOption(models.Model):
_description = "Sale Options"
_order = 'sequence, id'
order_id = fields.Many2one('sale.order', 'Sale Order Reference', ondelete='cascade', index=True)
order_id = fields.Many2one('sale.order', 'Sales Order Reference', ondelete='cascade', index=True)
line_id = fields.Many2one('sale.order.line', on_delete="set null")
name = fields.Text('Description', required=True)
product_id = fields.Many2one('product.product', 'Product', domain=[('sale_ok', '=', True)])
@@ -49,9 +49,9 @@
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation
to a Sale Order, then create the Invoice and collect the Payment.
to a Sales Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved
Note that once a Quotation becomes a Sales Order, it will be moved
from the Quotations list to the Sales Order list.
</p>
</field>
@@ -466,7 +466,7 @@
<ul class="list-inline">
<li groups="sales_team.group_sale_salesman">
<a t-if="quotation.state not in ('manual')" class="btn btn-info" t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (quotation._name, quotation.id, action)">Edit Quote</a>
<a t-if="quotation.state in ('manual')" class=" btn btn-info" t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (quotation._name, quotation.id, action)">Back to Sale Order</a>
<a t-if="quotation.state in ('manual')" class=" btn btn-info" t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (quotation._name, quotation.id, action)">Back to Sales Order</a>
</li>
<li>
<a class="btn btn-info" target="_blank" t-att-href="'/quote/%s/%s' % (quotation.id,quotation.access_token)+'?pdf=True'">Print</a>
+2 -2
View File
@@ -401,7 +401,7 @@ class WebsiteSale(http.Controller):
# ------------------------------------------------------
def checkout_redirection(self, order):
# must have a draft sale order with lines at this point, otherwise reset
# must have a draft sales order with lines at this point, otherwise reset
if not order or order.state != 'draft':
request.session['sale_order_id'] = None
request.session['sale_transaction_id'] = None
@@ -692,7 +692,7 @@ class WebsiteSale(http.Controller):
""" Payment step. This page proposes several payment means based on available
payment.acquirer. State at this point :
- a draft sale order with lines; otherwise, clean context / session and
- a draft sales order with lines; otherwise, clean context / session and
back to the shop
- no transaction in context / session, or only a draft one, if the customer
did go to a payment.acquirer website but closed the tab without
+1 -1
View File
@@ -43,7 +43,7 @@
<data>
<record id="sale.model_sale_order" model="ir.model">
<field name="website_form_access" eval="True"/>
<field name="website_form_label">Sale Order</field>
<field name="website_form_label">Sales Order</field>
</record>
<function model="ir.model.fields" name="formbuilder_whitelist">
<value>sale.order</value>
+2 -2
View File
@@ -40,13 +40,13 @@ class WebsiteConfigSettings(models.TransientModel):
module_portal = fields.Boolean("Activate the customer portal", help="""Give your customers access to their documents.""")
# the next 2 fields represent sale_pricelist_setting from sale.config.settings, they are split here for the form view, to improve usability
sale_pricelist_setting_split_1 = fields.Selection([
(0, 'A single sales price per product'),
(0, 'A single sale price per product'),
(1, 'Several prices selectable through a drop-down list or applied automatically via Geo-IP'),
], default=0, string="Pricing Strategy")
sale_pricelist_setting_split_2 = fields.Selection([
(0, 'Specific prices per customer segment, currency, etc.'),
(1, 'Advanced pricing based on formulas (discounts, margins, rounding)')
], default=0, string="Sales Price",
], default=0, string="Sale Price",
help='Specific prices per customer segment, currency, etc.: new pricing table available in product detail form (Sales tab).\n'
'Advanced pricing based on formulas (discounts, margins, rounding): apply price rules from a new *Pricelists* menu in Configuration.')
group_sale_pricelist = fields.Boolean("Use pricelists to adapt your price per customers",
+6 -6
View File
@@ -112,7 +112,7 @@ class SaleOrder(models.Model):
order_line = False
if self.state != 'draft':
request.session['sale_order_id'] = None
raise UserError(_('It is forbidden to modify a sale order which is not in draft status'))
raise UserError(_('It is forbidden to modify a sales order which is not in draft status'))
if line_id is not False:
order_lines = self._cart_find_product_line(product_id, line_id, **kwargs)
order_line = order_lines and order_lines[0]
@@ -304,13 +304,13 @@ class Website(models.Model):
@api.multi
def sale_get_order(self, force_create=False, code=None, update_pricelist=False, force_pricelist=False):
""" Return the current sale order after mofications specified by params.
:param bool force_create: Create sale order if not already existing
""" Return the current sales order after mofications specified by params.
:param bool force_create: Create sales order if not already existing
:param str code: Code to force a pricelist (promo code)
If empty, it's a special case to reset the pricelist with the first available else the default.
:param bool update_pricelist: Force to recompute all the lines from sale order to adapt the price with the current pricelist.
:param bool update_pricelist: Force to recompute all the lines from sales order to adapt the price with the current pricelist.
:param int force_pricelist: pricelist_id - if set, we change the pricelist with this one
:returns: browse record for the current sale order
:returns: browse record for the current sales order
"""
self.ensure_one()
partner = self.env.user.partner_id
@@ -465,4 +465,4 @@ class ResCountry(models.Model):
class ResPartner(models.Model):
_inherit = 'res.partner'
last_website_so_id = fields.Many2one('sale.order', string='Last Online Sale Order')
last_website_so_id = fields.Many2one('sale.order', string='Last Online Sales Order')
@@ -38,7 +38,7 @@ class SaleOrder(models.Model):
value = super(SaleOrder, self)._cart_update(product_id, line_id, add_qty, set_qty, **kwargs)
SaleOrderLineSudo = self.env['sale.order.line'].sudo()
line = SaleOrderLineSudo.browse(value.get('line_id'))
# link a product to the sale order
# link a product to the sales order
if kwargs.get('linked_line_id'):
linked_line = SaleOrderLineSudo.browse(kwargs['linked_line_id'])
line.write({