Skip to content

Commit

Permalink
[IMP] Terminology fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fpodoo committed Oct 3, 2015
1 parent e7418ce commit 52484b0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions addons/sale/wizard/sale_make_invoice_advance.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ def _get_advance_payment_method(self):
return 'delivered'

advance_payment_method = fields.Selection([
('all', 'Invoiceable lines (deduct deposits)'),
('delivered', 'Invoiceable lines'),
('percentage', 'Deposit (percentage)'),
('fixed', 'Deposit (fixed amount)')
('all', 'Invoiceable lines (deduct down payments)'),
('percentage', 'Down payment (percentage)'),
('fixed', 'Down payment (fixed amount)')
], string='What do you want to invoice?', default=_get_advance_payment_method, required=True)
product_id = fields.Many2one('product.product', string='Deposit Product', domain=[('type', '=', 'service')],\
product_id = fields.Many2one('product.product', string='Down Payment Product', domain=[('type', '=', 'service')],\
default=lambda self: self.env['ir.values'].get_default('sale.config.settings', 'deposit_product_id_setting'))
count = fields.Integer(default=_count, string='# of Orders')
amount = fields.Float('Deposit Amount', digits=dp.get_precision('Account'), help="The amount to be invoiced in advance, taxes excluded.")
amount = fields.Float('Down Payment Amount', digits=dp.get_precision('Account'), help="The amount to be invoiced in advance, taxes excluded.")
deposit_account_id = fields.Many2one("account.account", string="Income Account", domain=[('deprecated', '=', False)],\
help="Account used for deposits")
deposit_taxes_id = fields.Many2many("account.tax", string="Customer Taxes", help="Taxes used for deposits")
Expand Down Expand Up @@ -61,13 +61,13 @@ def _create_invoice(self, order, so_line, amount):
(self.product_id.name,))

if self.amount <= 0.00:
raise UserError(_('The value of the deposit amount must be positive.'))
raise UserError(_('The value of the down payment amount must be positive.'))
if self.advance_payment_method == 'percentage':
amount = order.amount_untaxed * self.amount / 100
name = _("Deposit of %s%%") % (self.amount,)
name = _("Down payment of %s%%") % (self.amount,)
else:
amount = self.amount
name = _('Deposit')
name = _('Down Payment')

invoice = inv_obj.create({
'name': order.client_order_ref or order.name,
Expand Down Expand Up @@ -119,9 +119,9 @@ def create_invoices(self):
else:
amount = self.amount
if self.product_id.invoice_policy != 'order':
raise UserError(_('The product used to invoice a deposit should have an invoice policy set to "Ordered quantities". Please update your deposit product to be able to create a deposit invoice.'))
raise UserError(_('The product used to invoice a down payment should have an invoice policy set to "Ordered quantities". Please update your deposit product to be able to create a deposit invoice.'))
if self.product_id.type != 'service':
raise UserError(_("The product used to invoice an deposit should be of type 'Service'. Please use another product or update this product."))
raise UserError(_("The product used to invoice a down payment should be of type 'Service'. Please use another product or update this product."))
so_line = sale_line_obj.create({
'name': _('Advance: %s') % (time.strftime('%m %Y'),),
'price_unit': amount,
Expand All @@ -139,7 +139,7 @@ def create_invoices(self):

def _prepare_deposit_product(self):
return {
'name': 'Deposit',
'name': 'Down payment',
'type': 'service',
'invoice_policy': 'order',
'property_account_income_id': self.deposit_account_id.id,
Expand Down

0 comments on commit 52484b0

Please sign in to comment.